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


Java ProcessModelInfo类代码示例

本文整理汇总了Java中com.raizlabs.android.dbflow.runtime.transaction.process.ProcessModelInfo的典型用法代码示例。如果您正苦于以下问题:Java ProcessModelInfo类的具体用法?Java ProcessModelInfo怎么用?Java ProcessModelInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ProcessModelInfo类属于com.raizlabs.android.dbflow.runtime.transaction.process包,在下文中一共展示了ProcessModelInfo类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addNewMarketTypes

import com.raizlabs.android.dbflow.runtime.transaction.process.ProcessModelInfo; //导入依赖的package包/类
public static void addNewMarketTypes(List<CrestMarketType> types, BehaviorSubject<Map.Entry<Integer, Integer>> subject) {
    int size = types.size();
    List<MarketTypeEntry> entries = new ArrayList<>(size);
    for (int i = 0; i < size; i++) {
        CrestMarketType type = types.get(i);

        MarketTypeEntry entry = new MarketTypeEntry();
        entry.id = type.getTypeId();
        entry.groupId = type.getGroupId();
        entry.href = type.getTypeHref();
        entry.icon = type.getTypeIcon();
        entry.name = type.getTypeName();
        entries.add(entry);
    }

    TransactionManager manager = TransactionManager.getInstance();
    ProcessModelTransaction transaction = new SaveModelTransaction<>(ProcessModelInfo.withModels(entries));

    transaction.setChangeListener((current, maxProgress, modifiedModel) -> {
        if (current % 25 == 0 || current == maxProgress) {
            subject.onNext(new AbstractMap.SimpleEntry<>((int) current, (int) maxProgress));
        }
    });

    manager.addTransaction(transaction);
}
 
开发者ID:w9jds,项目名称:MarketBot,代码行数:27,代码来源:MarketTypeEntry.java

示例2: addRegions

import com.raizlabs.android.dbflow.runtime.transaction.process.ProcessModelInfo; //导入依赖的package包/类
public static void addRegions(List<CrestItem> regions) {
    int size = regions.size();
    List<RegionEntry> entries = new ArrayList<>(size);
    for (int i = 0; i < size; i++) {
        CrestItem region = regions.get(i);

        RegionEntry entry = new RegionEntry();
        entry.id = region.getId();
        entry.name = region.getName();
        entry.href = region.getHref();
        entries.add(entry);
    }

    TransactionManager.getInstance().addTransaction(new SaveModelTransaction<>(
            ProcessModelInfo.withModels(entries)));
}
 
开发者ID:w9jds,项目名称:MarketBot,代码行数:17,代码来源:RegionEntry.java

示例3: addNewMarketGroups

import com.raizlabs.android.dbflow.runtime.transaction.process.ProcessModelInfo; //导入依赖的package包/类
public static void addNewMarketGroups(List<CrestMarketGroup> groups) {
    int count = groups.size();
    List<MarketGroupEntry> entries = new ArrayList<>(count);
    for (int i = 0; i < count; i++) {
        CrestMarketGroup group = groups.get(i);

        MarketGroupEntry entry = new MarketGroupEntry();
        entry.id = group.getId();
        entry.description = group.getDescription();
        entry.name = group.getName();
        entry.href = group.getHref();
        entry.parent = group.hasParent() ? group.getParentRef() : null;
        entry.parentId = group.hasParent() ? group.getParentId() : null;
        entry.types = group.getTypeRef();
        entries.add(entry);
    }

    TransactionManager.getInstance().addTransaction(new SaveModelTransaction<>(
            ProcessModelInfo.withModels(entries)));
}
 
开发者ID:w9jds,项目名称:MarketBot,代码行数:21,代码来源:MarketGroupEntry.java

示例4: saveBatch

import com.raizlabs.android.dbflow.runtime.transaction.process.ProcessModelInfo; //导入依赖的package包/类
public void saveBatch(){
    //Save questions in batch
    new SaveModelTransaction<>(ProcessModelInfo.withModels(questions)).onExecute();

    //Refresh media references
    List<Media> medias = questionBuilder.getListMedia();
    for(Media media: medias){
        media.updateQuestion();
    }
    //Save media in batch
    new SaveModelTransaction<>(ProcessModelInfo.withModels(medias)).onExecute();
}
 
开发者ID:EyeSeeTea,项目名称:EDSApp,代码行数:13,代码来源:ConvertFromSDKVisitor.java


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