Package org.wildfly.common.format
Class NumericFlags
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<E>
-
- org.wildfly.common.flags.Flags<E,This>
-
- org.wildfly.common.format.NumericFlags
-
- All Implemented Interfaces:
java.lang.Iterable<NumericFlag>,java.util.Collection<NumericFlag>,java.util.Set<NumericFlag>,java.util.SortedSet<NumericFlag>
public final class NumericFlags extends Flags<E,This>
-
-
Field Summary
Fields Modifier and Type Field Description static NumericFlagsNONEThe empty set of numeric flags.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected NumericFlagcastItemOrNull(java.lang.Object obj)Get the item (cast to the correctenumtype), ornullif it is not of the correct type.protected NumericFlagscastThis(java.lang.Object obj)Cast the given object to this class, throwing an exception if the cast fails.voidforbid(E flag)voidforbidAll()voidforbidAllBut(E flag)protected NumericFlagitemOf(int index)Get the flag item with the given index.static NumericFlagsof(NumericFlag flag)static NumericFlagsof(NumericFlag flag1, NumericFlag flag2)protected NumericFlagsthis_()Returnthis.protected NumericFlagsvalue(int bits)Get the set value of the given bit combination.-
Methods inherited from class org.wildfly.common.flags.Flags
comparator, complement, contains, contains, containsAll, containsAll, containsAll, containsAll, containsAny, containsAny, containsAny, descendingIterator, equals, equals, equals, first, forEach, hashCode, headSet, isEmpty, iterator, last, size, subSet, tailSet, toArray, toArray, toString, with, with, with, with, with, without, without
-
-
-
-
Field Detail
-
NONE
public static final NumericFlags NONE
The empty set of numeric flags.
-
-
Method Detail
-
of
public static NumericFlags of(NumericFlag flag)
-
of
public static NumericFlags of(NumericFlag flag1, NumericFlag flag2)
-
this_
protected NumericFlags this_()
Description copied from class:FlagsReturnthis.- Specified by:
this_in classFlags<NumericFlag,NumericFlags>- Returns:
this
-
value
protected NumericFlags value(int bits)
Description copied from class:FlagsGet the set value of the given bit combination. The bit combination may contain extraneous one-bits so any bits beyond the bit of the last flag should be masked off if an array is used for lookup.- Specified by:
valuein classFlags<NumericFlag,NumericFlags>- Parameters:
bits- the bit combination (possibly with extra bits)- Returns:
- the set instance
-
itemOf
protected NumericFlag itemOf(int index)
Description copied from class:FlagsGet the flag item with the given index.- Specified by:
itemOfin classFlags<NumericFlag,NumericFlags>- Parameters:
index- the index- Returns:
- the flag
-
castItemOrNull
protected NumericFlag castItemOrNull(java.lang.Object obj)
Description copied from class:FlagsGet the item (cast to the correctenumtype), ornullif it is not of the correct type.- Specified by:
castItemOrNullin classFlags<NumericFlag,NumericFlags>- Parameters:
obj- the object to cast- Returns:
- the cast object, or
null
-
castThis
protected NumericFlags castThis(java.lang.Object obj)
Description copied from class:FlagsCast the given object to this class, throwing an exception if the cast fails.- Specified by:
castThisin classFlags<NumericFlag,NumericFlags>- Parameters:
obj- the object to cast- Returns:
- the cast object
-
forbidAll
public final void forbidAll()
-
forbidAllBut
public final void forbidAllBut(E flag)
-
forbid
public void forbid(E flag)
-
-