Java Code Examples for io.realm.RealmFieldType#LIST
The following examples show how to use
io.realm.RealmFieldType#LIST .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RealmBarDataSet.java From NetKnight with Apache License 2.0 | 6 votes |
@Override public BarEntry buildEntryFromResultObject(T realmObject, int xIndex) { DynamicRealmObject dynamicObject = new DynamicRealmObject(realmObject); if (dynamicObject.getFieldType(mValuesField) == RealmFieldType.LIST) { RealmList<DynamicRealmObject> list = dynamicObject.getList(mValuesField); float[] values = new float[list.size()]; int i = 0; for (DynamicRealmObject o : list) { values[i] = o.getFloat(mStackValueFieldName); i++; } return new BarEntry(values, mIndexField == null ? xIndex : dynamicObject.getInt(mIndexField)); } else { float value = dynamicObject.getFloat(mValuesField); return new BarEntry(value, mIndexField == null ? xIndex : dynamicObject.getInt(mIndexField)); } }
Example 2
Source File: RealmBarDataSet.java From JNChartDemo with Apache License 2.0 | 6 votes |
@Override public BarEntry buildEntryFromResultObject(T realmObject, int xIndex) { DynamicRealmObject dynamicObject = new DynamicRealmObject(realmObject); if (dynamicObject.getFieldType(mValuesField) == RealmFieldType.LIST) { RealmList<DynamicRealmObject> list = dynamicObject.getList(mValuesField); float[] values = new float[list.size()]; int i = 0; for (DynamicRealmObject o : list) { values[i] = o.getFloat(mStackValueFieldName); i++; } return new BarEntry(values, mIndexField == null ? xIndex : dynamicObject.getInt(mIndexField)); } else { float value = dynamicObject.getFloat(mValuesField); return new BarEntry(value, mIndexField == null ? xIndex : dynamicObject.getInt(mIndexField)); } }
Example 3
Source File: RealmBarDataSet.java From MPAndroidChart-Realm with Apache License 2.0 | 6 votes |
@Override public BarEntry buildEntryFromResultObject(T realmObject, float x) { DynamicRealmObject dynamicObject = new DynamicRealmObject(realmObject); if (dynamicObject.getFieldType(mYValuesField) == RealmFieldType.LIST) { RealmList<DynamicRealmObject> list = dynamicObject.getList(mYValuesField); float[] values = new float[list.size()]; int i = 0; for (DynamicRealmObject o : list) { values[i] = o.getFloat(mStackValueFieldName); i++; } return new BarEntry( mXValuesField == null ? x : dynamicObject.getFloat(mXValuesField), values); } else { float value = dynamicObject.getFloat(mYValuesField); return new BarEntry(mXValuesField == null ? x : dynamicObject.getFloat(mXValuesField), value); } }