public abstract class RealmBaseDataSet<T extends RealmObject,S extends Entry> extends BaseDataSet<S>
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
mIndexField
fieldname of the column that contains the x-indices of this dataset
|
protected java.util.List<S> |
mValues
a cached list of all data read from the database
|
protected java.lang.String |
mValuesField
fieldname of the column that contains the y-values of this dataset
|
protected float |
mYMax
maximum y-value in the y-value array
|
protected float |
mYMin
the minimum y-value in the y-value array
|
protected <any> |
results
a list of queried realm objects
|
mAxisDependency, mColors, mDrawValues, mHighlightEnabled, mValueColors, mValueFormatter, mValueTextSize, mValueTypeface, mVisible| Constructor and Description |
|---|
RealmBaseDataSet(<any> results,
java.lang.String yValuesField) |
RealmBaseDataSet(<any> results,
java.lang.String yValuesField,
java.lang.String xIndexField)
Constructor that takes the realm RealmResults, sorts & stores them.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addEntry(S e)
Adds an Entry to the DataSet dynamically.
|
void |
addEntryOrdered(S e)
Adds an Entry to the DataSet dynamically.
|
void |
build(<any> results)
Rebuilds the DataSet based on the given RealmResults.
|
S |
buildEntryFromResultObject(T realmObject,
int xIndex) |
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.
|
java.util.List<S> |
getEntriesForXIndex(int xIndex)
Returns all Entry objects found at the given xIndex with binary
search.
|
int |
getEntryCount()
Returns the number of y-values this DataSet represents -> the size of the y-values array
-> yvals.size()
|
S |
getEntryForIndex(int index)
Returns the Entry object found at the given index (NOT xIndex) in the values array.
|
S |
getEntryForXIndex(int xIndex)
Returns the first Entry object found at the given xIndex with binary
search.
|
S |
getEntryForXIndex(int xIndex,
DataSet.Rounding rounding)
Returns the first Entry object found at the given xIndex with binary
search.
|
int |
getEntryIndex(int x,
DataSet.Rounding rounding)
Returns the first Entry index found at the given xIndex with binary
search.
|
int |
getEntryIndex(S e)
Returns the position of the provided entry in the DataSets Entry array.
|
java.lang.String |
getIndexField()
Returns the fieldname that represents the "x-index" in the realm-data.
|
<any> |
getResults() |
java.util.List<S> |
getValues()
Returns the List of values that has been extracted from the RealmResults
using the provided fieldnames.
|
java.lang.String |
getValuesField()
Returns the fieldname that represents the "y-values" in the realm-data.
|
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.
|
float[] |
getYValsForXIndex(int xIndex)
Returns all of the y values of the Entry objects at the given xIndex.
|
boolean |
removeEntry(S e)
Removes an Entry from the DataSets entries array.
|
void |
setIndexField(java.lang.String xIndexField)
Sets the field name that is used for getting the x-indices out of the RealmResultSet.
|
void |
setValuesField(java.lang.String yValuesField)
Sets the field name that is used for getting the y-values out of the RealmResultSet.
|
addColor, contains, getAxisDependency, getColor, getColor, getColors, getIndexInEntries, getLabel, getValueColors, 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 <any> results
protected java.util.List<S extends Entry> mValues
protected float mYMax
protected float mYMin
protected java.lang.String mValuesField
protected java.lang.String mIndexField
public RealmBaseDataSet(<any> results,
java.lang.String yValuesField)
public RealmBaseDataSet(<any> results,
java.lang.String yValuesField,
java.lang.String xIndexField)
results - yValuesField - xIndexField - public void build(<any> results)
public float getYMin()
IDataSetpublic float getYMax()
IDataSetpublic int getEntryCount()
IDataSetpublic void calcMinMax(int start,
int end)
IDataSetstart - starting index in your data listend - ending index in your data listpublic S getEntryForXIndex(int xIndex)
IDataSetpublic S getEntryForXIndex(int xIndex, DataSet.Rounding rounding)
IDataSetrounding - determine to round up/down/closest if there is no Entry matching the provided x-indexpublic java.util.List<S> getEntriesForXIndex(int xIndex)
IDataSetpublic S getEntryForIndex(int index)
IDataSetpublic int getEntryIndex(int x,
DataSet.Rounding rounding)
IDataSetrounding - determine to round up/down/closest if there is no Entry matching the provided x-indexpublic int getEntryIndex(S e)
IDataSetpublic float getYValForXIndex(int xIndex)
IDataSetpublic float[] getYValsForXIndex(int xIndex)
IDataSetpublic boolean addEntry(S e)
IDataSetpublic boolean removeEntry(S e)
IDataSetpublic void addEntryOrdered(S e)
IDataSetpublic java.util.List<S> getValues()
public void clear()
IDataSetpublic <any> getResults()
public java.lang.String getValuesField()
public void setValuesField(java.lang.String yValuesField)
yValuesField - public java.lang.String getIndexField()
public void setIndexField(java.lang.String xIndexField)
xIndexField -