com.sun.faban.harness.common
Class RunId

java.lang.Object
  extended by com.sun.faban.harness.common.RunId
All Implemented Interfaces:
Comparable

public class RunId
extends Object
implements Comparable

The RunId class represents a run name and provides standard facilities to decode the run name. The RunId class is immutable.

Author:
Akara Sucharitakul

Constructor Summary
RunId(String runId)
          Parses a string representation of a runId into the RunId object.
RunId(String benchName, String runSeq)
          Constructs a run name based on the benchmark name and the run sequence.
RunId(String host, String benchName, String runSeq)
          Constructs a run name based on the host name, the benchmark name, and the run sequence.
 
Method Summary
 int compareSeq(RunId o)
          Compares the run sequence between one and the other run id.
 int compareTo(Object o)
          Compares this object with the specified object for order.
 String getBenchName()
          Returns the benchmark name portion of the run id.
 String getHostName()
          Returns the host portion of the run id.
 File getResultDir()
          Return the result directory associated with this run.
 String getRunSeq()
          Returns the sequence portion of the run id.
 String toString()
          Returns the string representation of RunId in the form bench.seq.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RunId

public RunId(String benchName,
             String runSeq)
Constructs a run name based on the benchmark name and the run sequence.

Parameters:
benchName - The benchmark name
runSeq - The run id

RunId

public RunId(String host,
             String benchName,
             String runSeq)
Constructs a run name based on the host name, the benchmark name, and the run sequence.

Parameters:
host - The host name
benchName - The benchmark name
runSeq - The run sequence

RunId

public RunId(String runId)
Parses a string representation of a runId into the RunId object.

Parameters:
runId - The run id.
Method Detail

getHostName

public String getHostName()
Returns the host portion of the run id.

Returns:
The host name

getBenchName

public String getBenchName()
Returns the benchmark name portion of the run id.

Returns:
The benchmark name

getRunSeq

public String getRunSeq()
Returns the sequence portion of the run id.

Returns:
The run sequence

getResultDir

public File getResultDir()
Return the result directory associated with this run.

Returns:
The result directory for this run

toString

public String toString()
Returns the string representation of RunId in the form bench.seq.

Overrides:
toString in class Object
Returns:
A string representation of the object.

compareTo

public int compareTo(Object o)
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.

Specified by:
compareTo in interface Comparable
Parameters:
o - the Object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
ClassCastException - if the specified object's type prevents it from being compared to this Object.

compareSeq

public int compareSeq(RunId o)
Compares the run sequence between one and the other run id. Returns a negative integer, zero, or a positive integer as this sequence is less than, equal to, or greater than the specified run id's sequence.

Parameters:
o - The other run id.
Returns:
a negative integer, zero, or a positive integer as this run id is less than, equal to, or greater than the specified run id.