|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.nexttext.PropertySet
public class PropertySet
The PropertySet encapsulates the named properties of an object.
The PropertySet is a map from property names to Property objects. It is similar to java.util.Map, except that once a Property object has been added to the PropertySet that object cannot be removed or replaced, the name will always map to the very same Property object. Making the Properties static in this way makes it easier to write code which uses Properties. It allows original Property values to be stored correctly, it reduces the number of checks that have to be done in behaviours, and means that concurrent access is feasible.
Constructor Summary | |
---|---|
PropertySet()
|
Method Summary | |
---|---|
Property |
get(java.lang.String name)
Get the named property, null if it's not there. |
java.util.Set<java.lang.String> |
getNames()
Names of all the properties, in an unmodifiable set. |
void |
init(java.util.Map<java.lang.String,Property> properties)
Initialize all the properties in the map, if not already defined. |
void |
init(java.lang.String name,
Property value)
Initialize the property with this value, if it's not already defined. |
void |
reset()
Resets all the properties to their original value. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertySet()
Method Detail |
---|
public void init(java.lang.String name, Property value)
The provided property is cloned before it is added to the property list.
public void init(java.util.Map<java.lang.String,Property> properties)
See initProperty(String, Property). Map keys must be Strings, values must be Properties.
public Property get(java.lang.String name)
public java.util.Set<java.lang.String> getNames()
public void reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |