Class ThreeValuedBitSet

java.lang.Object
org.tweetyproject.arg.adf.util.ThreeValuedBitSet

public final class ThreeValuedBitSet extends Object
Inspired by BitSet but with three values.
Author:
Mathias Hofer
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new bitset with the specified size and all values undefined.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if all elements in the bitSet are true.
    void
    clear(int index)
    Sets the value at position to undecided resp.
    get(int i)
    Getter
    increment(int i)
    Increments the value at the specified position.
    void
    set(int i, Boolean value)
    Setter value
    int
    Return size
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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

      public Boolean increment(int i)
      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

      public Boolean get(int i)
      Getter
      Parameters:
      i - index
      Returns:
      bit at index
    • set

      public void set(int i, Boolean value)
      Setter value
      Parameters:
      i - index
      value - value to set
    • allTrue

      public boolean allTrue()
      Checks if all elements in the bitSet are true.
      Returns:
      true if all elements in the bitSet are true, otherwise false.
    • 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

      public String toString()
      Overrides:
      toString in class Object