Package gaiasky.render
Class ComponentTypes
- java.lang.Object
-
- java.util.BitSet
-
- gaiasky.render.ComponentTypes
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class ComponentTypes extends java.util.BitSetBitSet with some added functionality- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classComponentTypes.ComponentType
-
Field Summary
Fields Modifier and Type Field Description static intCT_SIZE
-
Constructor Summary
Constructors Constructor Description ComponentTypes()ComponentTypes(int ordinal)ComponentTypes(ComponentTypes.ComponentType... cts)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallSetLike(ComponentTypes other)Checks if all the t bits in this bit set are also set in other.intgetFirstOrdinal()Returns the index of the rightmost bit set to 1.booleanisEnabled(ComponentTypes.ComponentType ct)Checks whether the givenComponentTypes.ComponentTypeis enabled in thisComponentTypesinstancejava.lang.StringtoString()-
Methods inherited from class java.util.BitSet
and, andNot, cardinality, clear, clear, clear, clone, equals, flip, flip, get, get, hashCode, intersects, isEmpty, length, nextClearBit, nextSetBit, or, previousClearBit, previousSetBit, set, set, set, set, size, stream, toByteArray, toLongArray, valueOf, valueOf, valueOf, valueOf, xor
-
-
-
-
Field Detail
-
CT_SIZE
public static final int CT_SIZE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ComponentTypes
public ComponentTypes()
-
ComponentTypes
public ComponentTypes(int ordinal)
-
ComponentTypes
public ComponentTypes(ComponentTypes.ComponentType... cts)
-
-
Method Detail
-
getFirstOrdinal
public int getFirstOrdinal()
Returns the index of the rightmost bit set to 1. If no bits are set to 1, returns -1- Returns:
- The first ordinal
-
allSetLike
public boolean allSetLike(ComponentTypes other)
Checks if all the t bits in this bit set are also set in other.- Parameters:
other- The bit set to check against- Returns:
- True if all the bits set to true in this bit set are also true in other. Returns false otherwise
-
isEnabled
public boolean isEnabled(ComponentTypes.ComponentType ct)
Checks whether the givenComponentTypes.ComponentTypeis enabled in thisComponentTypesinstance- Parameters:
ct- The component type to check- Returns:
- True if the component type is enabled
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.util.BitSet
-
-