com.rubecula.jquantity
Class QuantityProperties

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

public class QuantityProperties
extends ConvenientProperties
implements Lookupable

Class to model JQuantities which can be read from a properties file, stored back and looked up (using a key string) the application.

Since:
V_0_4
Version:
$Revision: 1.3 $
Author:
Robin Hillyard
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.Hashtable
 
Field Summary
 
Fields inherited from class com.rubecula.util.ConvenientProperties
 
Fields inherited from class java.util.Properties
defaults
 
Fields inherited from class java.util.Hashtable
 
Constructor Summary
QuantityProperties()
           
QuantityProperties(java.io.File file)
           
QuantityProperties(java.io.InputStream stream)
           
QuantityProperties(java.util.Properties defaults)
           
QuantityProperties(java.lang.String file)
           
 
Method Summary
 java.util.Collection getKeys()
           
 Presentable getValue(java.lang.String name)
          Method to lookup a value by name.
 
Methods inherited from class com.rubecula.util.ConvenientProperties
getComment, getProperty, keys, list, setComment
 
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
 

Constructor Detail

QuantityProperties

public QuantityProperties()

QuantityProperties

public QuantityProperties(java.util.Properties defaults)
Parameters:
defaults -

QuantityProperties

public QuantityProperties(java.io.InputStream stream)
                   throws java.io.IOException

QuantityProperties

public QuantityProperties(java.io.File file)
                   throws java.io.FileNotFoundException,
                          java.io.IOException

QuantityProperties

public QuantityProperties(java.lang.String file)
                   throws java.io.FileNotFoundException,
                          java.io.IOException
Method Detail

getKeys

public java.util.Collection getKeys()
Specified by:
getKeys in interface Lookupable

getValue

public Presentable getValue(java.lang.String name)
                     throws PresentableException
Description copied from interface: Lookupable
Method to lookup a value by name.

Specified by:
getValue in interface Lookupable
Parameters:
name - the name or key to be looked up.
Returns:
a Presentable value corresponding to the current value of name.
Throws:
PresentableException - name not be found.