Class IntBitfield<V extends IntBitFieldValue>

java.lang.Object
de.linusdev.lutils.bitfield.IntBitfield<V>
Type Parameters:
V - field value

public class IntBitfield<V extends IntBitFieldValue> extends Object
Bitfield class using an int. It is not thread safe!
  • Constructor Details

    • IntBitfield

      public IntBitfield(@NotNull V flag)
    • IntBitfield

      public IntBitfield(@NotNull V flag1, @NotNull V flag2)
    • IntBitfield

      public IntBitfield(@NotNull V flag1, @NotNull V flag2, @NotNull V flag3)
    • IntBitfield

      public IntBitfield(@NotNull V flag1, @NotNull V flag2, @NotNull V flag3, @NotNull V flag4)
    • IntBitfield

      @SafeVarargs public IntBitfield(@NotNull @NotNull V @NotNull ... flags)
    • IntBitfield

      public IntBitfield(int value)
    • IntBitfield

      public IntBitfield()
  • Method Details

    • getValue

      public int getValue()
      Get the value of this bitfield
      Returns:
      bitfield as int
    • replaceWith

      public void replaceWith(int value)
    • reset

      public void reset()
      reset this bitfield to 0
    • isSet

      public boolean isSet(@NotNull V flag)
      checks if given flag is set.
      Parameters:
      flag - flag to check
      Returns:
      true if given flag is set in this bitfield.
    • isSet

      public boolean isSet(int flag)
      checks if given flag is set.
      Parameters:
      flag - flag to check
      Returns:
      true if given flag is set in this bitfield.
    • set

      public void set(@NotNull V flag)
      Sets given flag(s) to 1.
      Parameters:
      flag - flag to set
    • set

      public void set(@NotNull V flag1, @NotNull V flag2)
      Sets given flag(s) to 1.
      Parameters:
      flag1 - flag to set
    • set

      public void set(@NotNull V flag1, @NotNull V flag2, @NotNull V flag3)
      Sets given flag(s) to 1.
      Parameters:
      flag1 - flag to set
    • set

      public void set(@NotNull V flag1, @NotNull V flag2, @NotNull V flag3, @NotNull V flag4)
      Sets given flag(s) to 1.
      Parameters:
      flag1 - flag to set
    • set

      @SafeVarargs public final void set(@NotNull @NotNull V @NotNull ... flags)
      Sets given flag(s) to 1.
      Parameters:
      flags - flags to set
    • set

      public void set(int flag)
    • unset

      public void unset(@NotNull V flag)
    • unset

      public void unset(int flag)