public abstract class DataSet<T extends Entry> extends BaseDataSet<T>
| Modifier and Type | Class and Description |
|---|---|
static class |
DataSet.Rounding
Determines how to round DataSet index values for
getEntryIndex(int, Rounding) DataSet.getEntryIndex()}
when an exact x-index is not found. |
| Modifier and Type | Field and Description |
|---|---|
protected float |
mYMax
maximum y-value in the y-value array
|
protected float |
mYMin
the minimum y-value in the y-value array
|
protected java.util.List<T> |
mYVals
the entries that this dataset represents / holds together
|
mAxisDependency, mColors, mDrawValues, mHighlightEnabled, mValueColors, mValueFormatter, mValueTextSize, mValueTypeface, mVisible| Constructor and Description |
|---|
DataSet(java.util.List<T> yVals,
java.lang.String label)
Creates a new DataSet object with the given values it represents.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addEntry(T e)
Adds an Entry to the DataSet dynamically.
|
void |
addEntryOrdered(T e)
Adds an Entry to the DataSet dynamically.
|
void |
calcMinMax(int start,
int end)
Calculates the minimum and maximum y value (mYMin, mYMax).
|
void |
clear()
Removes all values from this DataSet and does all necessary recalculations.
|
abstract DataSet<T> |
copy()
Provides an exact copy of the DataSet this method is used on.
|
java.util.List<T> |
getEntriesForXIndex(int xIndex)
Returns all Entry objects at the given xIndex.
|
int |
getEntryCount()
Returns the number of y-values this DataSet represents -> the size of the y-values array
-> yvals.size()
|
T |
getEntryForIndex(int index)
Returns the Entry object found at the given index (NOT xIndex) in the values array.
|
T |
getEntryForXIndex(int xIndex)
Returns the first Entry object found at the given xIndex with binary
search.
|
T |
getEntryForXIndex(int xIndex,
DataSet.Rounding rounding)
Returns the first Entry object found at the given xIndex with binary
search.
|
int |
getEntryIndex(Entry e)
Returns the position of the provided entry in the DataSets Entry array.
|
int |
getEntryIndex(int xIndex,
DataSet.Rounding rounding)
Returns the first Entry index found at the given xIndex with binary
search.
|
float |
getYMax()
returns the maximum y-value this DataSet holds
|
float |
getYMin()
returns the minimum y-value this DataSet holds
|
float |
getYValForXIndex(int xIndex)
Returns the value of the Entry object at the given xIndex.
|
java.util.List<T> |
getYVals()
Returns the array of y-values that this DataSet represents.
|
boolean |
removeEntry(T e)
Removes an Entry from the DataSets entries array.
|
java.lang.String |
toSimpleString()
Returns a simple string representation of the DataSet with the type and
the number of Entries.
|
java.lang.String |
toString() |
addColor, contains, getAxisDependency, getColor, getColor, getColors, getIndexInEntries, getLabel, getValueFormatter, getValueTextColor, getValueTextColor, getValueTextSize, getValueTypeface, isDrawValuesEnabled, isHighlightEnabled, isVisible, notifyDataSetChanged, removeEntry, removeFirst, removeLast, resetColors, setAxisDependency, setColor, setColor, setColors, setColors, setColors, setColors, setDrawValues, setHighlightEnabled, setLabel, setValueFormatter, setValueTextColor, setValueTextColors, setValueTextSize, setValueTypeface, setVisibleprotected java.util.List<T extends Entry> mYVals
protected float mYMax
protected float mYMin
public DataSet(java.util.List<T> yVals, java.lang.String label)
yVals - label - public void calcMinMax(int start,
int end)
IDataSetstart - starting index in your data listend - ending index in your data listpublic int getEntryCount()
IDataSetpublic java.util.List<T> getYVals()
public abstract DataSet<T> copy()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toSimpleString()
public float getYMin()
IDataSetpublic float getYMax()
IDataSetpublic void addEntryOrdered(T e)
IDataSetpublic void clear()
IDataSetpublic boolean addEntry(T e)
IDataSetpublic boolean removeEntry(T e)
IDataSetpublic int getEntryIndex(Entry e)
IDataSetpublic T getEntryForXIndex(int xIndex, DataSet.Rounding rounding)
IDataSetrounding - determine to round up/down/closest if there is no Entry matching the provided x-indexpublic T getEntryForXIndex(int xIndex)
IDataSetpublic T getEntryForIndex(int index)
IDataSetpublic int getEntryIndex(int xIndex,
DataSet.Rounding rounding)
IDataSetrounding - determine to round up/down/closest if there is no Entry matching the provided x-indexpublic float getYValForXIndex(int xIndex)
IDataSetpublic java.util.List<T> getEntriesForXIndex(int xIndex)
xIndex -