Class GeneralValuedBitSet

java.lang.Object
org.tweetyproject.logics.translators.adfconditional.GeneralValuedBitSet

public final class GeneralValuedBitSet extends Object
Similar to the ThreeValuedBitSet but with arbitrary values allowed Can be used for 4-valued interpretations but also for anything above that!
Author:
Jonas Schumacher
  • Constructor Summary

    Constructors
    Constructor
    Description
    GeneralValuedBitSet(int size, int maxValue)
    Creates a new bitset with the specified size and all values set to 0
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    void
    clear(int index)
    Sets the value at given position to 0
    int
    get(int i)
    get the value of the bit at position i
    int
    increment(int i)
    Increments the value at the specified position.
    void
    set(int i, int value)
    sets the value of the bit at position i
    int
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GeneralValuedBitSet

      public GeneralValuedBitSet(int size, int maxValue)
      Creates a new bitset with the specified size and all values set to 0
      Parameters:
      size - the fixed size of the bitset
      maxValue - maxValue
  • Method Details

    • increment

      public int increment(int i)
      Increments the value at the specified position. If the value is already set to maxValue, it resets the current position and increments position i+1 The order of the values is 0, 1, 2, etc.
      Parameters:
      i - the position
      Returns:
      the new value at position i
    • get

      public int get(int i)
      get the value of the bit at position i
      Parameters:
      i - = position
      Returns:
      the value of the position
    • set

      public void set(int i, int value)
      sets the value of the bit at position i
      Parameters:
      i - = position
      value - = value to be set
    • allTrue

      public boolean allTrue()
      Returns:
      true, if all values are set to max value
    • clear

      public void clear(int index)
      Sets the value at given position to 0
      Parameters:
      index - the index of the bit to clear
    • size

      public int size()
      Returns:
      size