|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hecl.Properties
public class Properties
The Properties
class is used to parse command line
arguments. Its basic usage pattern is like so: a new Properties is
instantiated with default properties and values, then setProps is
called with argv. At that point the rest of the command can go on,
and for every prop that's needed, it can be fetched with getProp.
Field Summary | |
---|---|
protected java.util.Hashtable |
props
|
Constructor Summary | |
---|---|
Properties()
Creates a new Properties instance with no default
properties. |
|
Properties(java.lang.Object[] defaultprops)
Creates a new Properties instance with default
properties and their values. |
Method Summary | |
---|---|
void |
delProp(java.lang.String name)
delProp removes a property from the property set. |
boolean |
existsProp(java.lang.String name)
The existsProp method is used to determine if a
property exists or not. |
Thing |
getAndDelProp(java.lang.String name)
The getAndDelProp method fetches and deletes the
value associated with 'name', or returns null if there is no
value associated with it. |
Thing |
getProp(java.lang.String name)
The getProp method fetches the value of a
property. |
Thing |
getProp(java.lang.String name,
Thing defaultVal)
The getProp method with two arguments fetches the
value of the property given by 'name', or, if that does not
exist, returns a default value. |
Thing[] |
getProps()
getProps converts the properties back into an
array of Thing s. |
boolean |
isEmpty()
isEmpty test if property set is empty. |
void |
setProp(java.lang.String name,
Thing val)
The setProp method sets a single property to some
value. |
void |
setProps(Thing[] argv,
int offset)
The setProps method sets properties with their
values from the command line argv. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Hashtable props
Constructor Detail |
---|
public Properties()
Properties
instance with no default
properties.
public Properties(java.lang.Object[] defaultprops)
Properties
instance with default
properties and their values.
defaultprops
- an Object[]
valueMethod Detail |
---|
public void setProps(Thing[] argv, int offset) throws HeclException
setProps
method sets properties with their
values from the command line argv. The number of Things
handled must be even.
argv
- a Thing[]
valueoffset
- an int
value
HeclException
- if an error occurspublic void setProp(java.lang.String name, Thing val)
setProp
method sets a single property to some
value.
name
- a String
valueval
- a Thing
valuepublic Thing getProp(java.lang.String name)
getProp
method fetches the value of a
property.
name
- a String
value
Thing
valuepublic Thing getProp(java.lang.String name, Thing defaultVal)
getProp
method with two arguments fetches the
value of the property given by 'name', or, if that does not
exist, returns a default value.
name
- a String
valuedefaultVal
- a Thing
value
Thing
valuepublic boolean existsProp(java.lang.String name)
existsProp
method is used to determine if a
property exists or not.
name
- a String
value
boolean
valuepublic Thing getAndDelProp(java.lang.String name)
getAndDelProp
method fetches and deletes the
value associated with 'name', or returns null if there is no
value associated with it.
name
- a String
value
Thing
valuepublic void delProp(java.lang.String name)
delProp
removes a property from the property set.
name
- a String
valuepublic Thing[] getProps()
getProps
converts the properties back into an
array of Thing
s.
Thing
s, being property name
and property value.public boolean isEmpty()
isEmpty
test if property set is empty.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |