com.panayotis.gnuplot
Class PropertiesHolder

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<java.lang.String,java.lang.String>
          extended by com.panayotis.gnuplot.PropertiesHolder
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,java.lang.String>
Direct Known Subclasses:
AbstractPlot, Axis, ExpandableTerminal, FillStyle, GNUPlotParameters, PlotStyle

public class PropertiesHolder
extends java.util.HashMap<java.lang.String,java.lang.String>

This object is a data placeholder of various text-based parameters, used in JavaPlot graph objects.
It is possible to retrieve all it's data, as long a valid key-value pair is present.

See Also:
Serialized Form

Field Summary
protected static java.lang.String NL
           
 
Constructor Summary
PropertiesHolder()
          Creates a new instance of PropertiesHolder with default prefix and suffix values.
The prefix in this case is the token "set " and the suffix is the newline character.
PropertiesHolder(java.lang.String prefix, java.lang.String suffix)
          Creates a new instance of PropertiesHolder with given prefix and suffix tokens.
 
Method Summary
 void appendProperties(java.lang.StringBuffer bf)
          Retrieve the list of the stored key-value pairs in this object.
 void set(java.lang.String key)
          Set a specific key to this object, without a value
 void set(java.lang.String key, java.lang.String value)
          Add a specific key-value pair to this object.
 void unset(java.lang.String key)
          Remove a key from this object
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

NL

protected static final java.lang.String NL
Constructor Detail

PropertiesHolder

public PropertiesHolder()
Creates a new instance of PropertiesHolder with default prefix and suffix values.
The prefix in this case is the token "set " and the suffix is the newline character.


PropertiesHolder

public PropertiesHolder(java.lang.String prefix,
                        java.lang.String suffix)
Creates a new instance of PropertiesHolder with given prefix and suffix tokens.

Parameters:
prefix - The prefix to use
suffix - The suffix to use.
Method Detail

set

public void set(java.lang.String key,
                java.lang.String value)
Add a specific key-value pair to this object.

Parameters:
key - The key to use
value - The value of the specified parameter.
If value is null, then this key will be removed.

set

public void set(java.lang.String key)
Set a specific key to this object, without a value

Parameters:
key - The key to add to this object

unset

public void unset(java.lang.String key)
Remove a key from this object

Parameters:
key - The key to be removed

appendProperties

public void appendProperties(java.lang.StringBuffer bf)
Retrieve the list of the stored key-value pairs in this object. Every pair will be prefixed with "prefix" and suffixed with "suffix". Between key and value will be a space character, if and only if the value is present.

Parameters:
bf - The StringBuffer to store the representation of this object.