Class LongBitfield<V extends LongBitFieldValue>

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

public class LongBitfield<V extends LongBitFieldValue> extends Object
Bitfield class using a long. It is not thread safe!
  • Constructor Details

    • LongBitfield

      public LongBitfield(@NotNull V flag)
    • LongBitfield

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

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

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

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

      public LongBitfield(long value)
    • LongBitfield

      public LongBitfield()
  • Method Details

    • getValue

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

      public void replaceWith(long 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(long 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 - flag to set
    • set

      public void set(long flag)
    • unset

      public void unset(@NotNull V flag)
    • unset

      public void unset(long flag)