Class LongVolatileBitfield<V extends LongBitFieldValue>

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

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

    • LongVolatileBitfield

      public LongVolatileBitfield(@NotNull V flag)
    • LongVolatileBitfield

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

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

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

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

      public LongVolatileBitfield(long value)
    • LongVolatileBitfield

      public LongVolatileBitfield()
  • Method Details

    • replaceWith

      public void replaceWith(long value)
    • getValue

      public long getValue()
      Get the value of this bitfield
      Returns:
      bitfield as int
    • 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 - flags to set
    • set

      public void set(@NotNull V flag1, @NotNull V flag2, @NotNull V flag3)
      Sets given flag(s) to 1.
      Parameters:
      flag1 - flags 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 - flags 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(long flag)
    • unset

      public void unset(@NotNull V flag)
    • unset

      public void unset(long flag)