superwaba.ext.xplat.util.props
Class Properties

java.lang.Object
  |
  +--superwaba.ext.xplat.util.props.Properties
Direct Known Subclasses:
Options

public class Properties
extends Object

Class used to store properties pairs (key,value). A hashtable is used to store them. Currently, the key must be a String and the value must be a Value (Properties.Str, Properties.Int, Properties.Double, Properties.Long, Properties.Boolean. The properties can be saved and loaded to/from a DataStream.


Inner Class Summary
static class Properties.Boolean
          Implements a value of type boolean
static class Properties.Double
          Implements a value of type double
static class Properties.Int
          Implements a value of type int
static class Properties.Long
          Implements a value of type long
static class Properties.Str
          Implements a value of type String
static class Properties.Value
          Represents a generic value that can be stored here.
 
Constructor Summary
Properties()
           
Properties(String[] keys, Properties.Value[] values)
          Stores the given keys/values pairs in a new Properties.
 
Method Summary
 void clear()
          Clears this property
 Properties.Value get(String key)
          Get the value given the key from the hashtable that stores the properties.
 Vector getKeys()
          Returns a Vector with the current keys
 void load(DataStream ds)
          Load all properties from the given DataStream.
 void put(String key, Properties.Value v)
          Put the given key/value pair in the hashtable that stores the properties.
 void remove(String key)
          Remove a value from the property
 void save(DataStream ds)
          Save all properties in the given DataStream
 int size()
          Returns the number of properties
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, toString, wait, wait
 

Constructor Detail

Properties

public Properties()

Properties

public Properties(String[] keys,
                  Properties.Value[] values)
Stores the given keys/values pairs in a new Properties.
Method Detail

put

public void put(String key,
                Properties.Value v)
Put the given key/value pair in the hashtable that stores the properties.

get

public Properties.Value get(String key)
Get the value given the key from the hashtable that stores the properties.

size

public int size()
Returns the number of properties

getKeys

public Vector getKeys()
Returns a Vector with the current keys

clear

public void clear()
Clears this property

remove

public void remove(String key)
Remove a value from the property

save

public void save(DataStream ds)
Save all properties in the given DataStream

load

public void load(DataStream ds)
Load all properties from the given DataStream.