當前位置: 首頁>>代碼示例>>Java>>正文


Java Config.getIntList方法代碼示例

本文整理匯總了Java中com.typesafe.config.Config.getIntList方法的典型用法代碼示例。如果您正苦於以下問題:Java Config.getIntList方法的具體用法?Java Config.getIntList怎麽用?Java Config.getIntList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.typesafe.config.Config的用法示例。


在下文中一共展示了Config.getIntList方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: FFMModelDataFlow

import com.typesafe.config.Config; //導入方法依賴的package包/類
public FFMModelDataFlow(IFileSystem fs,
                       Config config,
                       ThreadCommSlave comm,
                       int threadNum,
                       boolean needPyTransform,
                       String pyTransformScript) throws Exception {
    super(fs, config,
            comm,
            threadNum,
            needPyTransform,
            pyTransformScript);

    List<Integer> klist = config.getIntList("k");
    K = new int[klist.size()];
    for (int i = 0; i < klist.size(); i++) {
        K[i] = klist.get(i);
    }
    //seed = config.getInt("seed");
    biasNeedLatentFactor = config.getBoolean("bias_need_latent_factor");

    needFirstOrder = (K[0] >= 1);
    needSecondOrder = (K[1] >= 1);

    fieldDelim = config.getString("data.delim.field_delim");
    fieldDictPath = config.getString("model.field_dict_path");

    randomParams = new RandomParams(config, "");

    LOG_UTILS.importantInfo("K:" + Arrays.toString(K));
    //LOG_UTILS.importantInfo("seed:" + seed);
    LOG_UTILS.importantInfo("random:" + randomParams);
    LOG_UTILS.importantInfo("bias_need_latent_factor:" + biasNeedLatentFactor);
    LOG_UTILS.importantInfo("need_first_order:" + needFirstOrder + ", need_second_order:" + needSecondOrder);
    LOG_UTILS.importantInfo("field_delim:" + fieldDelim + ", field_dict_path:" + fieldDictPath);

}
 
開發者ID:yuantiku,項目名稱:ytk-learn,代碼行數:37,代碼來源:FFMModelDataFlow.java

示例2: FMModelDataFlow

import com.typesafe.config.Config; //導入方法依賴的package包/類
public FMModelDataFlow(IFileSystem fs,
                           Config config,
                           ThreadCommSlave comm,
                           int threadNum,
                           boolean needPyTransform,
                           String pyTransformScript) throws Exception {
    super(fs, config,
            comm,
            threadNum,
            needPyTransform,
            pyTransformScript);

    List<Integer> klist = config.getIntList("k");
    K = new int[klist.size()];
    for (int i = 0; i < klist.size(); i++) {
        K[i] = klist.get(i);
    }
    //seed = config.getInt("seed");
    randomParams = new RandomParams(config, "");
    biasNeedLatentFactor = config.getBoolean("bias_need_latent_factor");

    needFirstOrder = (K[0] >= 1);
    needSecondOrder = (K[1] >= 1);

    LOG_UTILS.importantInfo("K:" + Arrays.toString(K));
    //comm.LOG_UTILS.importantInfo("seed:" + seed);
    LOG_UTILS.importantInfo("random:" + randomParams);
    LOG_UTILS.importantInfo("bias_need_latent_factor:" + biasNeedLatentFactor);
    LOG_UTILS.importantInfo("need_first_order:" + needFirstOrder + ", need_second_order:" + needSecondOrder);
}
 
開發者ID:yuantiku,項目名稱:ytk-learn,代碼行數:31,代碼來源:FMModelDataFlow.java

示例3: main

import com.typesafe.config.Config; //導入方法依賴的package包/類
public static void main(String[] args) {
    // {{start:resource}}
    Config defaultConfig = ConfigFactory.parseResources("defaults.conf");
    // {{end:resource}}

    // {{start:fallback}}
    Config fallbackConfig = ConfigFactory.parseResources("overrides.conf")
                                         .withFallback(defaultConfig)
                                         .resolve();
    // {{end:fallback}}

    // {{start:text}}
    log.info("name: {}", defaultConfig.getString("conf.name"));
    log.info("name: {}", fallbackConfig.getString("conf.name"));
    log.info("title: {}", defaultConfig.getString("conf.title"));
    log.info("title: {}", fallbackConfig.getString("conf.title"));
    // {{end:text}}

    // {{start:resolved}}
    log.info("combined: {}", fallbackConfig.getString("conf.combined"));
    // {{end:resolved}}

    // {{start:durations}}
    log.info("redis.ttl minutes: {}", fallbackConfig.getDuration("redis.ttl", TimeUnit.MINUTES));
    log.info("redis.ttl seconds: {}", fallbackConfig.getDuration("redis.ttl", TimeUnit.SECONDS));
    // {{end:durations}}

    // {{start:memorySize}}
    // Any path in the configuration can be treated as a separate Config object.
    Config uploadService = fallbackConfig.getConfig("uploadService");
    log.info("maxChunkSize bytes: {}", uploadService.getMemorySize("maxChunkSize").toBytes());
    log.info("maxFileSize bytes: {}", uploadService.getMemorySize("maxFileSize").toBytes());
    // {{end:memorySize}}

    // {{start:whitelist}}
    List<Integer> whiteList = fallbackConfig.getIntList("conf.nested.whitelistIds");
    log.info("whitelist: {}", whiteList);
    List<String> whiteListStrings = fallbackConfig.getStringList("conf.nested.whitelistIds");
    log.info("whitelist as Strings: {}", whiteListStrings);
    // {{end:whitelist}}


    // {{start:booleans}}
    log.info("yes: {}", fallbackConfig.getBoolean("featureFlags.featureA"));
    log.info("true: {}", fallbackConfig.getBoolean("featureFlags.featureB"));
    // {{end:booleans}}
}
 
開發者ID:StubbornJava,項目名稱:StubbornJava,代碼行數:48,代碼來源:TypesafeConfigExamples.java


注:本文中的com.typesafe.config.Config.getIntList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。