當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。