当前位置: 首页>>代码示例>>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;未经允许,请勿转载。