org.apache.commons.validator.util
public class Flags extends Object implements Serializable
There cannot be a flag with a value of 3 because that represents Flag 1 and Flag 2 both being on/true.
Version: $Revision: 478334 $ $Date: 2006-11-22 21:31:54 +0000 (Wed, 22 Nov 2006) $
Field Summary | |
---|---|
long | flags
Represents the current flag state. |
Constructor Summary | |
---|---|
Flags()
Create a new Flags object. | |
Flags(long flags)
Initialize a new Flags object with the given flags.
|
Method Summary | |
---|---|
void | clear()
Turn off all flags. |
Object | clone()
Clone this Flags object.
|
boolean | equals(Object obj)
Tests if two Flags objects are in the same state. |
long | getFlags()
Returns the current flags.
|
int | hashCode()
The hash code is based on the current state of the flags. |
boolean | isOff(long flag)
Tests whether the given flag is off. |
boolean | isOn(long flag)
Tests whether the given flag is on. |
String | toString()
Returns a 64 length String with the first flag on the right and the
64th flag on the left. |
void | turnOff(long flag)
Turns off the given flag. |
void | turnOffAll()
Turn off all flags. |
void | turnOn(long flag)
Turns on the given flag. |
void | turnOnAll()
Turn on all 64 flags. |
Parameters: flags collection of boolean flags to represent.
turnOffAll()
.Since: Validator 1.1.1
Returns: a copy of this object.
See Also: java.lang.Object#clone()
Parameters: obj object being tested
Returns: whether the objects are equal.
See Also: java.lang.Object#equals(java.lang.Object)
Returns: collection of boolean flags represented.
Returns: the hash code for this object.
See Also: java.lang.Object#hashCode()
Parameters: flag Flag value to check.
Returns: whether the specified flag value is off.
Parameters: flag Flag value to check.
Returns: whether the specified flag value is on.
Returns: string representation of this object.
Parameters: flag Flag value to turn off.
Parameters: flag Flag value to turn on.