Package edu.isi.pegasus.planner.classes
Class NameValue
- java.lang.Object
-
- edu.isi.pegasus.planner.classes.Data
-
- edu.isi.pegasus.planner.classes.NameValue
-
- All Implemented Interfaces:
java.lang.Cloneable
,java.lang.Comparable
public class NameValue extends Data implements java.lang.Comparable
The object of this class holds the name value pair. At present to be used for environment variables. Will be used more after integration of Spitfire.- Version:
- $Revision$
- Author:
- Karan Vahi, Gaurang Mehta
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
Returns a copy of this objectint
compareTo(java.lang.Object o)
Implementation of theComparable
interface.java.lang.String
getKey()
Returns the key associated with this tuple.java.lang.String
getValue()
Returns the value associated with this tuple.void
setKey(java.lang.String key)
Sets the key associated with this tuple.void
setValue(java.lang.String value)
Sets the value associated with this tuple.java.lang.String
toString()
Writes out the contents of the class to a String in form suitable for displaying.-
Methods inherited from class edu.isi.pegasus.planner.classes.Data
setToString, vectorToString
-
-
-
-
Constructor Detail
-
NameValue
public NameValue()
the default constructor which initialises the class member variables.
-
NameValue
public NameValue(java.lang.String name, java.lang.String value)
Initialises the class member variables to the values passed in the arguments.- Parameters:
name
- corresponds to the name in the NameValue pair.value
- corresponds to the value for the name in the NameValue pair.
-
-
Method Detail
-
setKey
public void setKey(java.lang.String key)
Sets the key associated with this tuple.- Parameters:
key
- the key associated with the tuple.
-
setValue
public void setValue(java.lang.String value)
Sets the value associated with this tuple.- Parameters:
value
- the value associated with the tuple.
-
getKey
public java.lang.String getKey()
Returns the key associated with this tuple.- Returns:
- the key associated with the tuple.
-
getValue
public java.lang.String getValue()
Returns the value associated with this tuple.- Returns:
- value associated with the tuple.
-
clone
public java.lang.Object clone()
Returns a copy of this object- Overrides:
clone
in classjava.lang.Object
- Returns:
- object containing a cloned copy of the tuple.
-
toString
public java.lang.String toString()
Writes out the contents of the class to a String in form suitable for displaying.
-
compareTo
public int compareTo(java.lang.Object o)
Implementation of theComparable
interface. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The NameValue are compared by their keys.- Specified by:
compareTo
in interfacejava.lang.Comparable
- Parameters:
o
- is the object to be compared- Returns:
- a negative number, zero, or a positive number, if the object compared against is less than, equals or greater than this object.
- Throws:
java.lang.ClassCastException
- if the specified object's type prevents it from being compared to this Object.
-
-