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.

Author:
asmuts
See Also:
Serialized Form

Nested Class Summary
(package private)  class PropertyGroups.PropertyKeysEnum
          Description of the Class
(package private)  class PropertyGroups.SimpleKeysEnum
          Description of the Class
 
Nested classes inherited from class java.util.Hashtable
 
Field Summary
(package private)  int compoundKeys
           
private  java.lang.String fileName
           
private  java.util.Properties props
           
(package private)  int simpleKeys
           
 
Fields inherited from class java.util.Hashtable
 
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
private  void keyVal(java.lang.StringBuffer sB, java.lang.Object key)
          Description of the Method
 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
 

Field Detail

props

private java.util.Properties props

fileName

private java.lang.String fileName

simpleKeys

int simpleKeys

compoundKeys

int compoundKeys
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


keyVal

private void keyVal(java.lang.StringBuffer sB,
                    java.lang.Object key)
Description of the Method


toString

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