- java.lang.Object
-
- org.ojalgo.type.EnumBitSet<E>
-
public final class EnumBitSet<E extends java.lang.Enum<E>> extends java.lang.ObjectLike aBitSetbut using anEnumas indices. TheEnumcannot have more than 64 values as the internal storage is a singlelong.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringMASK_MUST_HAVE_EXACTLY_ONE_BIT_SETprivate longmyBitSetStores the 64 boolean values
-
Constructor Summary
Constructors Constructor Description EnumBitSet()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidclear()Clears all bits, setting all booleans to false(package private) booleanget(long mask)Get the boolean value corresponding to the maskbooleanget(E index)(package private) longgetBitSet()Returns the internal long value (optional, useful for debugging or serialization)private static longmask(java.lang.Enum<?> index)(package private) voidset(long mask, boolean value)Set the boolean value corresponding to the maskvoidset(E index, boolean value)(package private) voidsetBitSet(long bitSet)Sets the internal long value directly (optional, useful for debugging or deserialization)
-
-
-
Field Detail
-
MASK_MUST_HAVE_EXACTLY_ONE_BIT_SET
private static final java.lang.String MASK_MUST_HAVE_EXACTLY_ONE_BIT_SET
- See Also:
- Constant Field Values
-
myBitSet
private long myBitSet
Stores the 64 boolean values
-
-
Method Detail
-
mask
private static long mask(java.lang.Enum<?> index)
-
get
public boolean get(E index)
-
set
public void set(E index, boolean value)
-
clear
void clear()
Clears all bits, setting all booleans to false
-
get
boolean get(long mask)
Get the boolean value corresponding to the mask
-
getBitSet
long getBitSet()
Returns the internal long value (optional, useful for debugging or serialization)
-
set
void set(long mask, boolean value)Set the boolean value corresponding to the mask
-
setBitSet
void setBitSet(long bitSet)
Sets the internal long value directly (optional, useful for debugging or deserialization)
-
-