com.ace.moab.api.credential.qos
Class QOSFlags

java.lang.Object
  extended by com.ace.moab.api.credential.qos.QOSFlags

public class QOSFlags
extends java.lang.Object

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

Author:
Brady Kimball

Constructor Summary
QOSFlags()
          The default constructor.
QOSFlags(java.lang.String flagsString)
          Constructor creates flag set based on input string.
 
Method Summary
 void addFlag(QOSFlag flag)
          Adds a flag to the set of flags.
 java.util.Set<QOSFlag> getFlags()
          Returns all flags as a Set.
 boolean isEmpty()
          Returns true if there are no flags set.
 boolean isIgnoreAllSet()
          If true, the QOSFlag.IGNALL flag is set; false, otherwise.
 boolean isSet(QOSFlag flag)
          Determine if this QoS contains a given QOSFlag
 void removeFlag(QOSFlag qosFlag)
          Attempts to remove the specified QOSFlag.
 void setFlags(java.util.Set<QOSFlag> flags)
          Sets the flags for a QoS.
 void setFromString(java.lang.String flagsString)
          Sets the set of flags based on a comma separated string of QOSFlag types.
 java.lang.String toDelimitedString(java.lang.String delimiter)
          Return a user-specified delimited list of this QoS's flags.
 java.lang.String toString()
          Return a comma delimited list of this QoS's flags
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QOSFlags

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


QOSFlags

public QOSFlags(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 QOSFlag object.

Parameters:
flagsString - a comma or colon separated list of QOSFlag types
See Also:
QOSFlag.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 QOSFlag types. See QOSFlag for different types

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

isSet

public boolean isSet(QOSFlag flag)
Determine if this QoS contains a given QOSFlag

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

toDelimitedString

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

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

toString

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

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

getFlags

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

Returns:
the flags' set for the QoS.

removeFlag

public void removeFlag(QOSFlag qosFlag)
Attempts to remove the specified QOSFlag. If the flag is not set, the remove request is ignored.

Parameters:
qosFlag - the flag to remove.

setFlags

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

Parameters:
flags - the set of flags to use.

addFlag

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

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

isEmpty

public boolean isEmpty()
Returns true if there are no flags set.

Returns:
true if there are no flags set; false if any flags are set.

isIgnoreAllSet

public boolean isIgnoreAllSet()
If true, the QOSFlag.IGNALL flag is set; false, otherwise.

Returns:
true ifthe QOSFlag.IGNALL flag is set; false, otherwise.


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