com.rubecula.util
Class ConvenientProperties

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended byjava.util.Properties
              extended bycom.rubecula.util.ConvenientProperties
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable
Direct Known Subclasses:
QuantityProperties

public class ConvenientProperties
extends java.util.Properties

Class to manage string properties with the following policy imposed:

Since:
V_0_5
Version:
$Revision: 1.2 $
Author:
Robin Hillyard
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.Hashtable
 
Field Summary
private static java.lang.String $S_HASH
           
 
Fields inherited from class java.util.Properties
defaults
 
Fields inherited from class java.util.Hashtable
 
Constructor Summary
ConvenientProperties()
           
ConvenientProperties(java.util.Properties defaults)
           
 
Method Summary
 java.lang.String getComment(java.lang.String key)
           
 java.lang.String getProperty(java.lang.String key)
          Method to get a property and strip off any comments and trailing spaces.
 java.util.Enumeration keys()
          This method overrides the keys() method of HashTable in order to force the Enumeration to be in alphabetical order.
 void list(java.io.PrintStream out)
           
 void setComment(java.lang.String key, java.lang.String comment)
           
 
Methods inherited from class java.util.Properties
getProperty, list, load, propertyNames, save, setProperty, store
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

$S_HASH

private static final java.lang.String $S_HASH
See Also:
Constant Field Values
Constructor Detail

ConvenientProperties

public ConvenientProperties()

ConvenientProperties

public ConvenientProperties(java.util.Properties defaults)
Parameters:
defaults -
Method Detail

getProperty

public java.lang.String getProperty(java.lang.String key)
Method to get a property and strip off any comments and trailing spaces.

Parameters:
key - the name of the property to get.
Returns:
the value of the property (with no trailing space or comments attached).
See Also:
Properties.getProperty(java.lang.String)

list

public void list(java.io.PrintStream out)

getComment

public java.lang.String getComment(java.lang.String key)
Returns:
Returns the comment (if any) or null.

setComment

public void setComment(java.lang.String key,
                       java.lang.String comment)
Parameters:
comment - The comment to set.

keys

public java.util.Enumeration keys()
This method overrides the keys() method of HashTable in order to force the Enumeration to be in alphabetical order.

See Also:
Dictionary.keys()