Package org.tweetyproject.arg.adf.util
Class ThreeValuedBitSet
java.lang.Object
org.tweetyproject.arg.adf.util.ThreeValuedBitSet
-
Constructor Summary
ConstructorDescriptionThreeValuedBitSet
(int size) Creates a new bitset with the specified size and all values undefined. -
Method Summary
Modifier and TypeMethodDescriptionboolean
allTrue()
Checks if all elements in thebitSet
aretrue
.void
clear
(int index) Sets the value at position to undecided resp.get
(int i) Getterincrement
(int i) Increments the value at the specified position.void
Setter valueint
size()
Return sizetoString()
-
Constructor Details
-
ThreeValuedBitSet
public ThreeValuedBitSet(int size) Creates a new bitset with the specified size and all values undefined.- Parameters:
size
- the fixed size of the bitset
-
-
Method Details
-
increment
Increments the value at the specified position. If the value is already true, it resets the current position and increments the one at i + 1.The order of the values is Undefined < False < True.
- Parameters:
i
- the position- Returns:
- the new value at position i
-
get
-
set
-
allTrue
public boolean allTrue()Checks if all elements in thebitSet
aretrue
.- Returns:
true
if all elements in thebitSet
aretrue
, otherwisefalse
.
-
clear
public void clear(int index) Sets the value at position to undecided resp.null
- Parameters:
index
- the index of the bit to clear
-
size
public int size()Return size- Returns:
- size
-
toString
-