de.fhstralsund.vinets.algorithm
Class Parameter

java.lang.Object
  extended by de.fhstralsund.vinets.algorithm.Parameter

public class Parameter
extends java.lang.Object

A class to encapsulate a Graph, a message String and further options to be passed from and to an Algorithm.


Constructor Summary
Parameter(Graph theGraph, java.lang.String theMessage)
          Constructs a new Parameter object.
 
Method Summary
 void appendMessage(java.lang.String s)
          Appends a text to the encapsulated message.
 boolean containsKey(java.lang.Object key)
          Returns true if the Parameter contains a mapping for the specified key.
 boolean getBooleanProperty(java.lang.Object key)
          Convenience method - equivalent to ((Boolean)getProperty(key)).booleanValue().
 double getDoubleProperty(java.lang.Object key)
          Convenience method - equivalent to ((Double)getProperty(key)).doubleValue().
 Graph getGraph()
          Delivers the encapsulated Graph object.
 int getIntProperty(java.lang.Object key)
          Convenience method - equivalent to ((Integer)getProperty(key)).intValue().
 java.lang.String getMessage()
          Delivers the encapsulated message.
 java.lang.Object getProperty(java.lang.Object key)
          Returns the value associated with the passed key.
 void setBooleanProperty(java.lang.Object key, boolean value)
          Convenience method - equivalent to setProperty(key, new Boolean(value)).
 void setDoubleProperty(java.lang.Object key, double x)
          Convenience method - equivalent to setProperty(key, new Double(x)).
 void setIntProperty(java.lang.Object key, int i)
          Convenience method - equivalent to setProperty(key, new Integer(i)).
 void setMessage(java.lang.String s)
          Changes the encapsulated message.
 void setProperty(java.lang.Object key, java.lang.Object value)
          Adds a new property to this Parameter object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parameter

public Parameter(Graph theGraph,
                 java.lang.String theMessage)
Constructs a new Parameter object.

Parameters:
theGraph - the Graph object to be encapsulated.
theMessage - a String containing a message. (If the null reference is passed here, an empty String is used.)
Method Detail

getGraph

public Graph getGraph()
Delivers the encapsulated Graph object.

Returns:
the Graph object.

getMessage

public java.lang.String getMessage()
Delivers the encapsulated message.

Returns:
the message String.

setMessage

public void setMessage(java.lang.String s)
Changes the encapsulated message.

Parameters:
s - the new message String.

appendMessage

public void appendMessage(java.lang.String s)
Appends a text to the encapsulated message.

Parameters:
s - the text to append.

setProperty

public void setProperty(java.lang.Object key,
                        java.lang.Object value)
Adds a new property to this Parameter object. The value should be associated by a key. The null reference is not allowed to be used as key. Notice, that keys are compared by their equals method.

Parameters:
key - an Object serving as key.
value - an Object to be stored with the associated key.

getProperty

public java.lang.Object getProperty(java.lang.Object key)
Returns the value associated with the passed key. If no such value exists since the key is not valid, the null reference is returned. A return value of null does not necessarily indicate that the Parameter contains no mapping for the key; it is also possible that the map explicitly maps the key to null. The containsKey method may be used to distinguish these two cases. Notice that keys are considered to be identical if a call to the equals method returns true. The null reference is not allowed to be used as key.

Parameters:
key - an Object serving as key.
Returns:
the Object associated to the passed key or null.

containsKey

public boolean containsKey(java.lang.Object key)
Returns true if the Parameter contains a mapping for the specified key.

Parameters:
key - the key whose presence is to be tested.
Returns:
true if the Parameter contains a mapping for the specified key.

setIntProperty

public void setIntProperty(java.lang.Object key,
                           int i)
Convenience method - equivalent to setProperty(key, new Integer(i)).

Parameters:
key - an Object serving as key.
i - an integer value to be associated with the specified key.
See Also:
setProperty(Object, Object)

getIntProperty

public int getIntProperty(java.lang.Object key)
Convenience method - equivalent to ((Integer)getProperty(key)).intValue().

Parameters:
key - an Object serving as key.
Returns:
the value to which the specified key is mapped or Integer.MAX_VALUE if there is no mapping for the key.
See Also:
getProperty(Object)

getDoubleProperty

public double getDoubleProperty(java.lang.Object key)
Convenience method - equivalent to ((Double)getProperty(key)).doubleValue().

Parameters:
key - an Object serving as key.
Returns:
the value to which the specified key is mapped or Double.NaN if there is no mapping for the key.
See Also:
getProperty(Object)

setDoubleProperty

public void setDoubleProperty(java.lang.Object key,
                              double x)
Convenience method - equivalent to setProperty(key, new Double(x)).

Parameters:
key - an Object serving as key.
x - a double value to be associated with the specified key.
See Also:
setProperty(Object, Object)

setBooleanProperty

public void setBooleanProperty(java.lang.Object key,
                               boolean value)
Convenience method - equivalent to setProperty(key, new Boolean(value)).

Parameters:
key - an Object serving as key.
value - true or false to be associated with the specified key.
See Also:
setProperty(Object, Object)

getBooleanProperty

public boolean getBooleanProperty(java.lang.Object key)
Convenience method - equivalent to ((Boolean)getProperty(key)).booleanValue().

Parameters:
key - an Object serving as key.
Returns:
the value to which the specified key is mapped or false if there is no mapping for the key.
See Also:
getProperty(Object)