com.ace.moab.api.jobs
Class JobFlags

java.lang.Object
  extended by com.ace.moab.api.jobs.JobFlags

public class JobFlags
extends java.lang.Object

This class represents the set of flags that a job could potentially have that modifies the behavior of a job. This is done to easily collect all flags.

Author:
Scott Brown

Constructor Summary
JobFlags()
          The default constructor.
JobFlags(java.lang.String flagsString)
          Constructor creates flag set based on input string.
 
Method Summary
 void addFlag(JobFlag flag)
          Adds a flag to the set of flags.
 java.util.Set<JobFlag> getFlags()
          Returns all flags as a Set.
 boolean isSet(JobFlag flag)
          Determine if this job contains a given JobFlag
 void setFlags(java.util.Set<JobFlag> flags)
          Sets the flags for a job.
 void setFromString(java.lang.String flagsString)
          Sets the set of flags based on a comma separated string of JobFlag types.
 java.lang.String toDelimitedString(java.lang.String delimiter)
          Return a user-specified delimited list of this job's job flags.
 java.lang.String toMoabCommandString()
          Return a colon delimited list of this job's flags as needed by Moab commands.
 java.lang.String toString()
          Return a comma delimited list of this job's flags
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JobFlags

public JobFlags()
The default constructor. There are no flags set when using this constructor.


JobFlags

public JobFlags(java.lang.String flagsString)
Constructor creates flag set based on input string. The input string should be comma separated or colon separated, and the string values should be associated with the enum values in the JobFlag object.

Parameters:
flagsString - a comma or colon separated list of JobFlag types
See Also:
JobFlag.parseString(String)
Method Detail

setFromString

public void setFromString(java.lang.String flagsString)
                   throws java.text.ParseException
Sets the set of flags based on a comma separated string of JobFlag types. See JobFlag for different types

Parameters:
flagsString - the comma or colon separated list of JobFlag types
Throws:
java.text.ParseException - thrown if any problems occur when trying to parse the job flags.

isSet

public boolean isSet(JobFlag flag)
Determine if this job contains a given JobFlag

Parameters:
flag - the flag to check
Returns:
true if and only if this job contains the flag

toDelimitedString

public java.lang.String toDelimitedString(java.lang.String delimiter)
Return a user-specified delimited list of this job's job flags.

Parameters:
delimiter - The string to use as a delimiter between each flag
Returns:
a user-specified delimited list of this job's job flags.

toMoabCommandString

public java.lang.String toMoabCommandString()
Return a colon delimited list of this job's flags as needed by Moab commands.

Returns:
a colon delimited list of this job's flags as needed by Moab commands.

toString

public java.lang.String toString()
Return a comma delimited list of this job's flags

Overrides:
toString in class java.lang.Object
Returns:
String representing set flags

getFlags

public java.util.Set<JobFlag> getFlags()
Returns all flags as a Set.

Returns:
the flags' set for the job.

setFlags

public void setFlags(java.util.Set<JobFlag> flags)
Sets the flags for a job.

Parameters:
flags - the set of flags to use.

addFlag

public void addFlag(JobFlag flag)
Adds a flag to the set of flags.

Parameters:
flag - the flag to add to the collection.


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