org.griphyn.cPlanner.classes
Class NameValue

java.lang.Object
  extended by org.griphyn.cPlanner.classes.Data
      extended by org.griphyn.cPlanner.classes.NameValue
All Implemented Interfaces:
Cloneable, Comparable

public class NameValue
extends Data
implements 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: 50 $
Author:
Karan Vahi, Gaurang Mehta

Field Summary
private  String name
          stores the name of the pair.
private  String value
          stores the corresponding value to the name in the pair.
 
Fields inherited from class org.griphyn.cPlanner.classes.Data
mLogger, mLogMsg
 
Constructor Summary
NameValue()
          the default constructor which initialises the class member variables.
NameValue(String name, String value)
          Initialises the class member variables to the values passed in the arguments.
 
Method Summary
 Object clone()
          Returns a copy of this object
 int compareTo(Object o)
          Implementation of the Comparable interface.
 String getKey()
          Returns the key associated with this tuple.
 String getValue()
          Returns the value associated with this tuple.
 String toString()
          Writes out the contents of the class to a String in form suitable for displaying.
 
Methods inherited from class org.griphyn.cPlanner.classes.Data
setToString, vectorToString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private String name
stores the name of the pair.


value

private String value
stores the corresponding value to the name in the pair.

Constructor Detail

NameValue

public NameValue()
the default constructor which initialises the class member variables.


NameValue

public NameValue(String name,
                 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

getKey

public String getKey()
Returns the key associated with this tuple.

Returns:
the key associated with the tuple.

getValue

public String getValue()
Returns the value associated with this tuple.

Returns:
value associated with the tuple.

clone

public Object clone()
Returns a copy of this object

Overrides:
clone in class Object
Returns:
object containing a cloned copy of the tuple.

toString

public String toString()
Writes out the contents of the class to a String in form suitable for displaying.

Specified by:
toString in class Data
Returns:
the textual description.

compareTo

public int compareTo(Object o)
Implementation of the Comparable 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 interface 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:
ClassCastException - if the specified object's type prevents it from being compared to this Object.


Copyright © 2007 The University of Southern California. All Rights Reserved.