com.ace.moab.api.variables
Class Variable

java.lang.Object
  extended by com.ace.moab.api.variables.Variable
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Variable>

public class Variable
extends java.lang.Object
implements java.lang.Comparable<Variable>, java.io.Serializable

This class represents a variable used for attaching miscellaneous information to an object in Moab.

Author:
bkimball
See Also:
Serialized Form

Constructor Summary
Variable(java.lang.String name, java.lang.String value)
          Initializes a new variable.
 
Method Summary
 int compareTo(Variable o)
          If the other variable is null, -1 is returned or else the names of the variables are compared lexographically.
 boolean equals(java.lang.Object o)
          
 java.lang.String getName()
          Returns the name of the variable.
 java.lang.String getValue()
          Returns the value of the variable.
 java.lang.String toMoabString()
           Creates a String suitable for building a command to send to Moab.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Variable

public Variable(java.lang.String name,
                java.lang.String value)
         throws java.lang.NullPointerException
Initializes a new variable.

Parameters:
name - the name of the variable. Cannot be null.
value - the associated value of the variable.
Throws:
java.lang.NullPointerException - thrown if name is null.
Method Detail

compareTo

public int compareTo(Variable o)
If the other variable is null, -1 is returned or else the names of the variables are compared lexographically.

Specified by:
compareTo in interface java.lang.Comparable<Variable>

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class java.lang.Object

getName

public java.lang.String getName()
Returns the name of the variable.

Returns:
the name of the variable.

getValue

public java.lang.String getValue()
Returns the value of the variable.

Returns:
the name of the variable.

toMoabString

public java.lang.String toMoabString()

Creates a String suitable for building a command to send to Moab.

For example, if the name is "os" and the value is "rhel3", the String to be returned is "os=rhel3".

Returns:
a String suitable for building a command to send to Moab.

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object


Copyright © 2001-2009 Cluster Resources, Inc. All Rights Reserved.