org.apache.jcs.utils.data
Class PropertyGroups

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended byorg.apache.jcs.utils.data.PropertyGroups
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class PropertyGroups
extends java.util.Hashtable

represent a file from the classpath, such as C:\JRun\jsm-default\classes\tst.properties which we load via load("\tst.properties") as a group of Properties in a hashtable; thus alpha_zip=1111 beta_zip=2222 gamma_zip=3333 alpha_zap=uggle wurple=wing beta_zap=wuggle zurple=zing becomes a PropertyGroups with Enumeration propertyKeys()=[alpha,beta,gamma] Enumeration simpleKeys()=[wurple,zurple] Properties getProperties("alpha") = {zip=1111,zap=uggle} String getProperty("wurple")=wing. String getProperty("alpha","bibble")=bibble It is an error to define a key both as a group name and a property: alpha=stringval would be an error; it would conflict with alpha_zip or alpha_zap. it is not an error to ask for a property whose name is a group name, but the answer is null.

See Also:
Serialized Form

Constructor Summary
PropertyGroups()
          Constructor for the PropertyGroups object
PropertyGroups(java.lang.String name)
          Constructor for the PropertyGroups object
 
Method Summary
 java.util.Properties getProperties(java.lang.String key)
          Gets the properties attribute of the PropertyGroups object
 java.lang.String getProperty(java.lang.String key)
          Gets the property attribute of the PropertyGroups object
 java.lang.String getProperty(java.lang.String key, java.lang.String dflt)
          Gets the property attribute of the PropertyGroups object
 void load()
          Description of the Method
 void load(java.lang.String name)
          Description of the Method
 java.util.Enumeration propertyKeys()
          Description of the Method
 java.util.Enumeration simpleKeys()
          Description of the Method
 java.lang.String toString()
          Description of the Method
 
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, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyGroups

public PropertyGroups()
Constructor for the PropertyGroups object


PropertyGroups

public PropertyGroups(java.lang.String name)
               throws java.lang.Exception
Constructor for the PropertyGroups object

Parameters:
name -
Throws:
java.lang.Exception
Method Detail

load

public void load(java.lang.String name)
          throws java.lang.Exception
Description of the Method

Throws:
java.lang.Exception

load

public void load()
          throws java.lang.Exception
Description of the Method

Throws:
java.lang.Exception

getProperty

public java.lang.String getProperty(java.lang.String key)
Gets the property attribute of the PropertyGroups object

Returns:
The property value

getProperty

public java.lang.String getProperty(java.lang.String key,
                                    java.lang.String dflt)
Gets the property attribute of the PropertyGroups object

Returns:
The property value

getProperties

public java.util.Properties getProperties(java.lang.String key)
Gets the properties attribute of the PropertyGroups object

Returns:
The properties value

propertyKeys

public java.util.Enumeration propertyKeys()
Description of the Method


simpleKeys

public java.util.Enumeration simpleKeys()
Description of the Method


toString

public java.lang.String toString()
Description of the Method



Copyright © 2002-2005 Apache Software Foundation. All Rights Reserved.