Class ComponentTypes
java.lang.Object
gaiasky.util.Bits
gaiasky.render.ComponentTypes
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class Bits
DEFAULT_LENGTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanallSetLike(ComponentTypes other) Checks if all the bits in this bit set are also set in the other.intReturns the index of the rightmost bit set to 1.booleanChecks whether the givenComponentTypes.ComponentTypeis enabled in thisComponentTypesinstancetoString()Methods inherited from class Bits
and, andNot, clear, clear, compareTo, containsAll, copy, empty, empty, equals, flip, from, get, getAndClear, getAndSet, has, hashCode, indices, intersects, is, isEmpty, length, nextClearBit, nextSetBit, notEmpty, numBits, or, set, setMask, xorModifier and TypeMethodDescriptionPerforms a logical AND of this target bit set with the argument bit set.Clears all the bits in this bit set whose corresponding bit is set in the specified bit set.voidclear()Clears the entire bitsetvoidclear(int index) intbooleancontainsAll(Bits other) Returns true if this bit set is a super set of the specified set, i.e.copy()static Bitsempty()static Bitsempty(int nBits) booleanvoidflip(int index) static Bitsfrom(long mask) booleanget(int index) booleangetAndClear(int index) Returns the bit at the given index and clears it in one go.booleangetAndSet(int index) Returns the bit at the given index and sets it in one go.booleanhas(int index) inthashCode()static Bitsindices(int... idx) booleanintersects(Bits other) Returns true if the specified BitSet has any bits set to true that are also set to true in this BitSet.booleanis(int index) booleanisEmpty()intlength()Returns the "logical size" of this bitset: the index of the highest set bit in the bitset plus one.intnextClearBit(int fromIndex) Returns the index of the first bit that is set to false that occurs on or after the specified starting index.intnextSetBit(int fromIndex) Returns the index of the first bit that is set to true that occurs on or after the specified starting index.booleannotEmpty()intnumBits()Performs a logical OR of this bit set with the bit set argument.voidset(int index) voidsetMask(long mask) Performs a logical XOR of this bit set with the bit set argument.
-
Field Details
-
CT_SIZE
public static final int CT_SIZE- See Also:
-
-
Constructor Details
-
ComponentTypes
public ComponentTypes() -
ComponentTypes
public ComponentTypes(int ordinal) -
ComponentTypes
-
-
Method Details
-
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
Checks if all the bits in this bit set are also set in the 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 the other. Returns false otherwise.
-
isEnabled
Checks whether the givenComponentTypes.ComponentTypeis enabled in thisComponentTypesinstance- Parameters:
ct- The component type to check- Returns:
- True if the component type is enabled
-
toString
-