本文整理汇总了Java中io.realm.DynamicRealmObject.getList方法的典型用法代码示例。如果您正苦于以下问题:Java DynamicRealmObject.getList方法的具体用法?Java DynamicRealmObject.getList怎么用?Java DynamicRealmObject.getList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.realm.DynamicRealmObject
的用法示例。
在下文中一共展示了DynamicRealmObject.getList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildEntryFromResultObject
import io.realm.DynamicRealmObject; //导入方法依赖的package包/类
@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));
}
}
示例2: buildEntryFromResultObject
import io.realm.DynamicRealmObject; //导入方法依赖的package包/类
@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);
}
}
示例3: build
import io.realm.DynamicRealmObject; //导入方法依赖的package包/类
@Override
public void build(RealmResults<T> results) {
for (T realmObject : results) {
DynamicRealmObject dynamicObject = new DynamicRealmObject(realmObject);
try { // normal entry
float value = dynamicObject.getFloat(mValuesField);
mValues.add(new BarEntry(value, dynamicObject.getInt(mIndexField)));
} catch (IllegalArgumentException e) { // stacked entry
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++;
}
mValues.add(new BarEntry(values, dynamicObject.getInt(mIndexField)));
}
}
calcStackSize();
}