Package de.linusdev.lutils.bitfield
Class IntBitfield<V extends IntBitFieldValue>
java.lang.Object
de.linusdev.lutils.bitfield.IntBitfield<V>
- Type Parameters:
V- field value
Bitfield class using an int. It is not thread safe!
-
Constructor Summary
ConstructorsConstructorDescriptionIntBitfield(int value) IntBitfield(@NotNull V @NotNull ... flags) IntBitfield(V flag) IntBitfield(V flag1, V flag2) IntBitfield(V flag1, V flag2, V flag3) IntBitfield(V flag1, V flag2, V flag3, V flag4) -
Method Summary
Modifier and TypeMethodDescriptionintgetValue()Get the value of this bitfieldbooleanisSet(int flag) checks if given flag is set.booleanchecks if given flag is set.voidreplaceWith(int value) voidreset()reset this bitfield to 0voidset(int flag) final voidSets given flag(s) to 1.voidSets given flag(s) to 1.voidSets given flag(s) to 1.voidSets given flag(s) to 1.voidSets given flag(s) to 1.voidunset(int flag) void
-
Constructor Details
-
IntBitfield
-
IntBitfield
-
IntBitfield
-
IntBitfield
-
IntBitfield
-
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
checks if given flag is set.- Parameters:
flag- flag to check- Returns:
trueif 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:
trueif given flag is set in this bitfield.
-
set
Sets given flag(s) to 1.- Parameters:
flag- flag to set
-
set
Sets given flag(s) to 1.- Parameters:
flag1- flag to set
-
set
Sets given flag(s) to 1.- Parameters:
flag1- flag to set
-
set
Sets given flag(s) to 1.- Parameters:
flag1- flag to set
-
set
Sets given flag(s) to 1.- Parameters:
flags- flags to set
-
set
public void set(int flag) -
unset
-
unset
public void unset(int flag)
-