当前位置: 首页>>代码示例>>Java>>正文


Java DynamicRealmObject.getList方法代码示例

本文整理汇总了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));
    }
}
 
开发者ID:pencil-box,项目名称:NetKnight,代码行数:24,代码来源:RealmBarDataSet.java

示例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);
    }
}
 
开发者ID:PhilJay,项目名称:MPAndroidChart-Realm,代码行数:23,代码来源:RealmBarDataSet.java

示例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();
}
 
开发者ID:rahulmaddineni,项目名称:Stayfit,代码行数:30,代码来源:RealmBarDataSet.java


注:本文中的io.realm.DynamicRealmObject.getList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。