Framework Professional Edition Package


com.prosyst.util.hash
Class XProperties

java.lang.Object
  extended by java.util.Dictionary
      extended by java.util.Hashtable
          extended by com.prosyst.util.hash.XProperties
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map

public class XProperties
extends java.util.Hashtable

Helper class for reading and writing properties in text file

See Also:
Serialized Form

Constructor Summary
XProperties()
          Constructs an empty XProperties instance, with initial capacity=30
 
Method Summary
 java.lang.Object get(java.lang.Object o)
          Retuns a the value of the property with name (String) o, or null if there is no such property.
 java.lang.Object get0(java.lang.Object o)
          Retuns a the value of the property with name (String) o, or null if there is no such property.
 boolean load(java.io.InputStream in)
          Loads the properties from the specified InputStream.
 void save(java.io.OutputStream out)
          Saves the properties in the specified OutputStream
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, 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

XProperties

public XProperties()
Constructs an empty XProperties instance, with initial capacity=30

Method Detail

save

public void save(java.io.OutputStream out)
Saves the properties in the specified OutputStream


load

public boolean load(java.io.InputStream in)
             throws java.io.IOException
Loads the properties from the specified InputStream. Property names a kept as Key instancies, property values are kept as byte[]-s.

Throws:
java.io.IOException

get

public java.lang.Object get(java.lang.Object o)
Retuns a the value of the property with name (String) o, or null if there is no such property. If the value is a byte[], converts it to String before returning it.

Specified by:
get in interface java.util.Map
Overrides:
get in class java.util.Hashtable
Parameters:
o - The name of the property

get0

public java.lang.Object get0(java.lang.Object o)
Retuns a the value of the property with name (String) o, or null if there is no such property. The value is returned without converting it to String


Framework Professional Edition Package


Copyright © 1999-2007 ProSyst Software GmbH. All Rights Reserved