|
Jumpi v1.2.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jumpi.impl.util.Properties
A Hashtable of String, key-value pairs. Properties are added by calling set and retrieved by calling get. A property can be removed by calling the remove method. A Properties instance can be made invariant by calling setReadOnly.
Constructor Summary | |
Properties()
Creates a new Properties object. |
|
Properties(java.util.Hashtable props)
Creates a new Properties object. |
Method Summary | |
java.lang.String |
get(java.lang.String name)
Get the value of the named property. |
java.lang.String |
get(java.lang.String name,
java.lang.String def)
Get the value of the named property if existing otherwise return the provided default value. |
boolean |
isReadOnly()
Whether the instance is read only or not. |
java.util.Enumeration |
keys()
Return all the property names. |
void |
remove(java.lang.String name)
Remove the named property. |
void |
set(java.lang.String name,
java.lang.String value)
Add the named property. |
void |
setReadOnly()
Make the properties invariant. |
int |
size()
Return the number of properties in the collection. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Properties()
public Properties(java.util.Hashtable props)
props
- a Hashtable of properties to use internally as the name
value pairs.
java.lang.IllegalArgumentException
- if props is null.Method Detail |
public void set(java.lang.String name, java.lang.String value)
set
in interface Properties
name
- the name of the property.value
- the value of the property.
java.lang.IllegalArgumentException
- if either name or value are null.
java.lang.IllegalStateException
- if read only.get(java.lang.String)
,
setReadOnly()
public java.lang.String get(java.lang.String name)
get
in interface Properties
name
- the name of the property.
java.lang.IllegalArgumentException
- if name is null.set(java.lang.String, java.lang.String)
public java.lang.String get(java.lang.String name, java.lang.String def)
get
in interface Properties
name
- the name of the property.def
- the default value of the property
java.lang.IllegalArgumentException
- if name is null.set(java.lang.String, java.lang.String)
public void remove(java.lang.String name)
remove
in interface Properties
name
- the name of the property to remove.
java.lang.IllegalArgumentException
- if name is null.
java.lang.IllegalStateException
- if read only.setReadOnly()
public void setReadOnly()
setReadOnly
in interface Properties
isReadOnly()
,
set(java.lang.String, java.lang.String)
,
remove(java.lang.String)
public java.util.Enumeration keys()
keys
in interface Properties
java.lang.IllegalStateException
- when not read only.public boolean isReadOnly()
setReadOnly()
public int size()
size
in interface Properties
|
Jumpi v1.2.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |