net.sf.cpsolver.ifs.util
Class DataProperties

java.lang.Object
  extended by java.util.Dictionary
      extended by java.util.Hashtable
          extended by java.util.Properties
              extended by net.sf.cpsolver.ifs.util.DataProperties
All Implemented Interfaces:
Serializable, Cloneable, Map

public class DataProperties
extends Properties

Data properties.

Version:
IFS 1.1 (Iterative Forward Search)
Copyright (C) 2006 Tomáš Müller
muller@unitime.org
Lazenska 391, 76314 Zlin, Czech Republic

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
DataProperties()
          Constructor
DataProperties(Dictionary properties)
          Constructor
DataProperties(Properties defaults)
          Constructor
 
Method Summary
 boolean containsPropery(String key)
          Returns true if there is such property
 void expand()
           
 String getProperty(String key, String defaultValue)
          Returns string property
 boolean getPropertyBoolean(String key, boolean defaultValue)
          Returns boolean property
 Boolean getPropertyBoolean(String key, Boolean defaultValue)
          Returns boolean property
 double getPropertyDouble(String key, double defaultValue)
          Returns double property
 Double getPropertyDouble(String key, Double defaultValue)
          Returns double property
 float getPropertyFloat(String key, float defaultValue)
          Returns float property
 Float getPropertyFloat(String key, Float defaultValue)
          Returns float property
 int getPropertyInt(String key, int defaultValue)
          Returns int property
 Integer getPropertyInteger(String key, Integer defaultValue)
          Returns int property
 Integer[] getPropertyIntegerArry(String key, Integer[] defaultValue)
           
 long getPropertyLong(String key, long defaultValue)
          Returns long property
 Long getPropertyLong(String key, Long defaultValue)
          Returns long property
 Long[] getPropertyLongArry(String key, Long[] defaultValue)
           
 void load(InputStream inputStream)
          Loads properties from an input stream
 void setProperty(String key, Object[] value)
           
 Object setProperty(String key, String value)
          Sets string property
 Dictionary toDict()
          Returns properties as dictionary.
 
Methods inherited from class java.util.Properties
getProperty, list, list, load, loadFromXML, propertyNames, save, store, store, storeToXML, storeToXML, stringPropertyNames
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataProperties

public DataProperties()
Constructor


DataProperties

public DataProperties(Properties defaults)
Constructor

Parameters:
defaults - default properties

DataProperties

public DataProperties(Dictionary properties)
Constructor

Parameters:
properties - default properties
Method Detail

getProperty

public String getProperty(String key,
                          String defaultValue)
Returns string property

Overrides:
getProperty in class Properties
Parameters:
key - key
defaultValue - default value to be returned when such property is not present

setProperty

public Object setProperty(String key,
                          String value)
Sets string property

Overrides:
setProperty in class Properties
Parameters:
key - key
value - value

getPropertyInt

public int getPropertyInt(String key,
                          int defaultValue)
Returns int property

Parameters:
key - key
defaultValue - default value to be returned when such property is not present

getPropertyLong

public long getPropertyLong(String key,
                            long defaultValue)
Returns long property

Parameters:
key - key
defaultValue - default value to be returned when such property is not present

getPropertyInteger

public Integer getPropertyInteger(String key,
                                  Integer defaultValue)
Returns int property

Parameters:
key - key
defaultValue - default value to be returned when such property is not present

getPropertyLong

public Long getPropertyLong(String key,
                            Long defaultValue)
Returns long property

Parameters:
key - key
defaultValue - default value to be returned when such property is not present

containsPropery

public boolean containsPropery(String key)
Returns true if there is such property

Parameters:
key - key

getPropertyBoolean

public boolean getPropertyBoolean(String key,
                                  boolean defaultValue)
Returns boolean property

Parameters:
key - key
defaultValue - default value to be returned when such property is not present

getPropertyDouble

public double getPropertyDouble(String key,
                                double defaultValue)
Returns double property

Parameters:
key - key
defaultValue - default value to be returned when such property is not present

getPropertyFloat

public float getPropertyFloat(String key,
                              float defaultValue)
Returns float property

Parameters:
key - key
defaultValue - default value to be returned when such property is not present

getPropertyBoolean

public Boolean getPropertyBoolean(String key,
                                  Boolean defaultValue)
Returns boolean property

Parameters:
key - key
defaultValue - default value to be returned when such property is not present

getPropertyDouble

public Double getPropertyDouble(String key,
                                Double defaultValue)
Returns double property

Parameters:
key - key
defaultValue - default value to be returned when such property is not present

getPropertyFloat

public Float getPropertyFloat(String key,
                              Float defaultValue)
Returns float property

Parameters:
key - key
defaultValue - default value to be returned when such property is not present

setProperty

public void setProperty(String key,
                        Object[] value)

getPropertyLongArry

public Long[] getPropertyLongArry(String key,
                                  Long[] defaultValue)

getPropertyIntegerArry

public Integer[] getPropertyIntegerArry(String key,
                                        Integer[] defaultValue)

toDict

public Dictionary toDict()
Returns properties as dictionary.


expand

public void expand()

load

public void load(InputStream inputStream)
          throws IOException
Loads properties from an input stream

Overrides:
load in class Properties
Throws:
IOException