dataholder
Class Properties

java.lang.Object
  extended by dataholder.Properties

public class Properties
extends java.lang.Object

A simple class to store and retrieve properties as (key-value) pairs

Author:
Peter Hlavac

Constructor Summary
Properties()
          Creates a new instance of Properties
 
Method Summary
 java.util.Vector convertToVector()
          Converts a list of properties into a vector (example for a vector element: key: "map", value: "gztan.png" --> vector: "map=gztan.png")
 java.lang.String getKeyAt(int i)
          Gets the key of a property at a given index
 java.lang.String getProperty(java.lang.String key)
          Gets the value of a property for a given key.
 java.lang.String getValueAt(int i)
          Gets the value of a property at a given index
 void setProperty(java.lang.String key, java.lang.String value)
          Sets the value for a given property.
 int size()
          Returns the number of properties
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Properties

public Properties()
Creates a new instance of Properties

Method Detail

getProperty

public java.lang.String getProperty(java.lang.String key)
Gets the value of a property for a given key.

Parameters:
key - the key of the property
Returns:
the value of the property

setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)
Sets the value for a given property.

Parameters:
key - the key of the property to set
value - the value of the property

size

public int size()
Returns the number of properties

Returns:
the number of properties

getKeyAt

public java.lang.String getKeyAt(int i)
Gets the key of a property at a given index

Parameters:
i - Index of the property
Returns:
the key of the property

getValueAt

public java.lang.String getValueAt(int i)
Gets the value of a property at a given index

Parameters:
i - Index of the property
Returns:
the key of the property

convertToVector

public java.util.Vector convertToVector()
Converts a list of properties into a vector (example for a vector element: key: "map", value: "gztan.png" --> vector: "map=gztan.png")

Returns:
a Vector of properties