Class NumericFlags

All Implemented Interfaces:
Iterable<NumericFlag>, Collection<NumericFlag>, Set<NumericFlag>, SortedSet<NumericFlag>

public final class NumericFlags extends Flags<E,This>
  • Field Details

    • NONE

      public static final NumericFlags NONE
      The empty set of numeric flags.
  • Method Details

    • of

      public static NumericFlags of(NumericFlag flag)
    • of

      public static NumericFlags of(NumericFlag flag1, NumericFlag flag2)
    • this_

      protected NumericFlags this_()
      Description copied from class: Flags
      Return this.
      Specified by:
      this_ in class Flags<NumericFlag,NumericFlags>
      Returns:
      this
    • value

      protected NumericFlags value(int bits)
      Description copied from class: Flags
      Get 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:
      value in class Flags<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: Flags
      Get the flag item with the given index.
      Specified by:
      itemOf in class Flags<NumericFlag,NumericFlags>
      Parameters:
      index - the index
      Returns:
      the flag
    • castItemOrNull

      protected NumericFlag castItemOrNull(Object obj)
      Description copied from class: Flags
      Get the item (cast to the correct enum type), or null if it is not of the correct type.
      Specified by:
      castItemOrNull in class Flags<NumericFlag,NumericFlags>
      Parameters:
      obj - the object to cast
      Returns:
      the cast object, or null
    • castThis

      protected NumericFlags castThis(Object obj)
      Description copied from class: Flags
      Cast the given object to this class, throwing an exception if the cast fails.
      Specified by:
      castThis in class Flags<NumericFlag,NumericFlags>
      Parameters:
      obj - the object to cast
      Returns:
      the cast object
    • forbidAll

      public final void forbidAll()
    • forbidAllBut

      public final void forbidAllBut(NumericFlag flag)
    • forbid

      public void forbid(NumericFlag flag)