Cytoscape 2.8.0 API

cytoscape.util
Class PropUtil

java.lang.Object
  extended by cytoscape.util.PropUtil

public class PropUtil
extends Object

A stateless utility class that makes it easy to parse int and boolean values from a Properties object.


Method Summary
static boolean getBoolean(Properties props, String key, boolean defaultValue)
          Will return a boolean for the specified property key only if the value exists and if the string matches "true", "false", "yes", or "no" in a case insensitive manner.
static float getFloat(Properties props, String key, float defaultValue)
          Will return a float for the specified property key only if the value exists and is properly formatted as an float.
static int getInt(Properties props, String key, int defaultValue)
          Will return an integer for the specified property key only if the value exists and is properly formatted as an integer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInt

public static int getInt(Properties props,
                         String key,
                         int defaultValue)
Will return an integer for the specified property key only if the value exists and is properly formatted as an integer. Otherwise it will return the defaultValue.


getFloat

public static float getFloat(Properties props,
                             String key,
                             float defaultValue)
Will return a float for the specified property key only if the value exists and is properly formatted as an float. Otherwise it will return the defaultValue.


getBoolean

public static boolean getBoolean(Properties props,
                                 String key,
                                 boolean defaultValue)
Will return a boolean for the specified property key only if the value exists and if the string matches "true", "false", "yes", or "no" in a case insensitive manner. Otherwise it will return the defaultValue.


Cytoscape 2.8.0 API

Copyright 2010 Cytoscape Consortium. All rights reserved.