com.ace.moab.api.reservation
Class ReservationFlags

java.lang.Object
  extended by com.ace.moab.api.reservation.ReservationFlags
All Implemented Interfaces:
java.lang.Comparable<ReservationFlags>

public class ReservationFlags
extends java.lang.Object
implements java.lang.Comparable<ReservationFlags>

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

Author:
Scott Brown

Constructor Summary
ReservationFlags()
          The default constructor.
ReservationFlags(java.lang.String flagsString)
          Constructor creates flag set based on input string.
 
Method Summary
 void addFlag(ReservationFlag flag)
          Adds a flag to the set of flags.
 int compareTo(ReservationFlags o)
          
 java.util.Set<ReservationFlag> getFlags()
          Returns all flags as a Set.
 boolean isSet(ReservationFlag flag)
          Determine if this reservation contains a given ReservationFlag
 void removeAll()
          Removes all flags from the list.
 void setFlags(java.util.Set<ReservationFlag> flags)
          Sets the flags for a reservation.
 void setFromString(java.lang.String flagsString)
          Sets the set of flags based on a comma or colon separated string of ReservationFlag types.
 java.lang.String toString()
          Return a comma delimited list of this reservation's flags
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReservationFlags

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


ReservationFlags

public ReservationFlags(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 ReservationFlag object.

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

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

isSet

public boolean isSet(ReservationFlag flag)
Determine if this reservation contains a given ReservationFlag

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

toString

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

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

getFlags

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

Returns:
the flags' set for the reservation.

setFlags

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

Parameters:
flags - the set of flags to use.

addFlag

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

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

compareTo

public int compareTo(ReservationFlags o)

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

removeAll

public void removeAll()
Removes all flags from the list.



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