|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.sape.carbon.core.util.enum.EnumMask
This class provides the functionality for searching sets of Enumerations. This allows for construction of this EnumMask with a statically defined array of Enum objects and then searching to see if one of the values is contained.
This class can be used like the following.
... private static final EnumMask GOOD_STATES = new EnumMask(new BaseEnum[] { StatesEnum.INDIANA, StatesEnum.IOWA, StatesEnum.IDAHO, StatesEnum.ILLINOIS }); public boolean isGoodState(StatesEnum state) { return GOOD_STATES.contains(state); } ...Copyright 2002 Sapient
Field Summary | |
private Set |
enums
The enums set that contains this mask |
Constructor Summary | |
EnumMask(BaseEnum[] keys)
Constructs a Mask object from the provided array of Enums. |
Method Summary | |
boolean |
contains(BaseEnum enum)
Checks to see if the enum exists in this mask. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private Set enums
Constructor Detail |
public EnumMask(BaseEnum[] keys)
Constructs a Mask object from the provided array of Enums.
keys
- The set of Enums that will be the MaskMethod Detail |
public boolean contains(BaseEnum enum)
Checks to see if the enum exists in this mask.
enum
- The enum to check for
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |