|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
com.sas.collection.CompositeProperties
public class CompositeProperties
CompositeProperties is a subclass of Properties
that aggregates multiple Properties objects.
Objects of class Properties can already be chained
together through their defaults field. This class,
CompositeProperties, allows for multiple Properties objects to be added
as defaults. In this way, a "tree" of CompositeProperties objects may
be created.
This class maintains a vector of defaults property objects, rather than
a single defaults property object. When defaults are added to the
CompositeProperties object, they are added at the head of the vector.
When searching the tree for a particular property, a depth-first
algorithm will be used, so that the last defaults added ( and it's
defaults ) have priority over those added earlier.
The defaults added may be of type CompositeProperties or its super
class Properties.
| Constructor Summary | |
|---|---|
CompositeProperties()
Constructor. |
|
CompositeProperties(java.util.Properties defaults)
Constructor with initial value to add to defaults vector. |
|
| Method Summary | |
|---|---|
void |
addDefaults(java.util.Properties defaults)
Add to defaults vector. |
boolean |
containsKey(java.lang.String key)
Test if specified key is found. |
java.lang.String |
getProperty(java.lang.String key)
Search for the property with the specified key. |
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue)
Search for the property with the specified key; return defaultValue if not found. |
void |
list(java.io.PrintStream out)
Print the property list out to the specified output stream. |
void |
list(java.io.PrintWriter out)
Print the property list out to the specified output stream. |
java.util.Enumeration |
propertyNames()
Return an Enumeration of property names, including those contained in the defaults vector. |
java.lang.Object |
remove(java.lang.Object key)
Remove a property, given its name. |
void |
removeAllProperties()
Remove all the properties. |
int |
size()
Count the number of properties, including those contained in the defaults vector. |
| Constructor Detail |
|---|
public CompositeProperties()
public CompositeProperties(java.util.Properties defaults)
| Method Detail |
|---|
public void addDefaults(java.util.Properties defaults)
public java.util.Enumeration propertyNames()
propertyNames in class java.util.Propertiespublic java.lang.String getProperty(java.lang.String key)
getProperty in class java.util.Properties
public java.lang.String getProperty(java.lang.String key,
java.lang.String defaultValue)
getProperty in class java.util.Propertiespublic boolean containsKey(java.lang.String key)
public int size()
size in interface java.util.Map<java.lang.Object,java.lang.Object>size in class java.util.Hashtable<java.lang.Object,java.lang.Object>public java.lang.Object remove(java.lang.Object key)
remove in interface java.util.Map<java.lang.Object,java.lang.Object>remove in class java.util.Hashtable<java.lang.Object,java.lang.Object>public void removeAllProperties()
public void list(java.io.PrintStream out)
list in class java.util.Propertiespublic void list(java.io.PrintWriter out)
list in class java.util.Properties
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||