Java Code Examples for org.apache.commons.configuration.Configuration.getDouble()

The following are Jave code examples for showing how to use getDouble() of the org.apache.commons.configuration.Configuration class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: bitsy   File: BitsyGraph.java   Source Code and License Vote up 6 votes
/** 
 * Constructor with a Configuration object with String dbPath, boolean allowFullGraphScans, long txLogThreshold and double reorgFactor 
 */
public BitsyGraph(Configuration configuration) {
	this(Paths.get(configuration.getString(DB_PATH_KEY)),
		configuration.getBoolean(ALLOW_FULL_GRAPH_SCANS_KEY, Boolean.TRUE),
		configuration.getLong(TX_LOG_THRESHOLD_KEY, DEFAULT_TX_LOG_THRESHOLD),
		configuration.getDouble(REORG_FACTOR_KEY, DEFAULT_REORG_FACTOR),
		configuration.getBoolean(CREATE_DIR_IF_MISSING_KEY, false));
	String isoLevelStr = configuration.getString(DEFAULT_ISOLATION_LEVEL_KEY);
	if (isoLevelStr != null) {
		setDefaultIsolationLevel(BitsyIsolationLevel.valueOf(isoLevelStr));
	}
	String vertexIndices = configuration.getString(VERTEX_INDICES_KEY);
	if (vertexIndices != null) {
		createIndices(Vertex.class, vertexIndices);
	}
	String edgeIndices = configuration.getString(EDGE_INDICES_KEY);
	if (edgeIndices != null) {
		createIndices(Edge.class, edgeIndices);
	}
	this.origConfig = configuration;
}
 
Example 2
Project: java-market-maker   File: MarketMakerConfiguration.java   Source Code and License Vote up 5 votes
public static MarketMakerConfiguration fromPropertiesFile(final String fileName) throws ConfigurationException {
    final Configuration configuration = new PropertiesConfiguration(fileName);
    return new MarketMakerConfiguration(
        configuration.getInt(ConfigKey.TIME_SLEEP_SECONDS.getKey()),
        new BigDecimal(configuration.getString(ConfigKey.SPREAD_FRACTION.getKey())),
        configuration.getDouble(ConfigKey.FAIR_VOLATILITY.getKey()),
        configuration.getDouble(ConfigKey.VOLATILITY_SPREAD_FRACTION.getKey()),
        configuration.getInt(ConfigKey.NUM_LEVELS.getKey()),
        configuration.getInt(ConfigKey.QUANTITY_ON_LEVEL.getKey()),
        configuration.getDouble(ConfigKey.DELTA_LIMIT.getKey()),
        configuration.getDouble(ConfigKey.VEGA_LIMIT.getKey())
    );
}