Class BitVector

java.lang.Object
fr.uga.pddl4j.util.BitSet
fr.uga.pddl4j.util.BitVector
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
State

public class BitVector extends BitSet
This class implements a bit vector.
Revisions:
  • 26.06.2020: Add shift methods.
See Also:
Serialized Form
  • Constructor Details

    • BitVector

      public BitVector(int size)
      Creates a new BitVector with a specific size.
      Parameters:
      size - the size of the bit vector.
    • BitVector

      public BitVector()
      Creates a new BitVector.
    • BitVector

      public BitVector(Condition exp)
      Creates a new BitVector from a specified BitExp.
      Parameters:
      exp - the BitExp that represents BitVector.
    • BitVector

      public BitVector(BitVector vector)
      Creates a new BitVector from an other state. This constructor is the copy constructor.
      Parameters:
      vector - the other BitVector to copy
  • Method Details

    • include

      public final boolean include(BitVector vector)
      Returns true if this bit vector includes an other specified BitVector. In other word, this method returns true if all the bits set to 1 in the specified vector are also set to 1 in this vector.
      Parameters:
      vector - the other bit vector.
      Returns:
      true if this bit vector includes an other specified BitVector; false otherwise.
    • exclude

      public final boolean exclude(BitVector vector)
      Returns true if this bit vector excludes an other specified BitVector. In other word, this method returns true if all the bits set to 1 in the specified vector are set to 0 in this vector.
      Parameters:
      vector - the other bit vector.
      Returns:
      true if this bit vector is included a other specified BitVector; false otherwise.
    • getIntersection

      public final BitVector getIntersection(BitVector vector)
      Return a bit vector that represents the intersection of this bit vector with an other.
      Parameters:
      vector - the other bit vector.
      Returns:
      Return a bit vector that represents the intersection of this bit vector with an other.
    • shiftRight

      public final void shiftRight(int n)
      Shifts right the bit vector of n bits.
      Parameters:
      n - the number of bit to shift. n must greater or equal 0.
    • shiftLeft

      public final void shiftLeft(int n)
      Shifts left the bit vector of n bits.
      Parameters:
      n - the number of bit to shift. n must greater of equal to 0.