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.BitSet
BitSet with some added functionality
See Also:
Serialized Form
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    static class  ComponentTypes.ComponentType  
  • Field Summary

    Fields
    Modifier and Type Field Description
    static int CT_SIZE  
  • Constructor Summary

    Constructors
    Constructor Description
    ComponentTypes()  
    ComponentTypes​(int ordinal)  
    ComponentTypes​(ComponentTypes.ComponentType... cts)  
  • Method Summary

    Modifier and Type Method Description
    boolean allSetLike​(ComponentTypes other)
    Checks if all the t bits in this bit set are also set in other.
    int getFirstOrdinal()
    Returns the index of the rightmost bit set to 1.
    boolean isEnabled​(ComponentTypes.ComponentType ct)
    Checks whether the given ComponentTypes.ComponentType is enabled in this ComponentTypes instance
    java.lang.String toString()  

    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

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • ComponentTypes

      public ComponentTypes()
    • ComponentTypes

      public ComponentTypes​(int ordinal)
    • ComponentTypes

      public ComponentTypes​(ComponentTypes.ComponentType... cts)
  • 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

      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 given ComponentTypes.ComponentType is enabled in this ComponentTypes instance
      Parameters:
      ct - The component type to check
      Returns:
      True if the component type is enabled
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.util.BitSet