Module org.maxicp

Class StateSparseBitSet

java.lang.Object
org.maxicp.state.datastructures.StateSparseBitSet

public class StateSparseBitSet extends Object
Class to represent a bit-set that can be saved and restored through the StateManager.saveState() / StateManager.restoreState()
  • Constructor Details

    • StateSparseBitSet

      public StateSparseBitSet(StateManager sm, int n)
      Creates a StateSparseSet with n bits, initially all set (value 1 for all)
      Parameters:
      sm - the state manager
      n - the number of bits
  • Method Details

    • isEmpty

      public boolean isEmpty()
      Test is the reversibleSparseBitSet is empty
      Returns:
      true is empty, false otherwise
    • remove

      public void remove(BitSet bs)
      Remove the content of the BitSet from this sparseBitSet
      Parameters:
      bs - the BitSet to remove
    • intersect

      public void intersect(BitSet bs)
      Intersect this sparseBitSet with bs
      Parameters:
      bs - the BitSet to intersect with
    • hasEmptyIntersection

      public boolean hasEmptyIntersection(BitSet bs)
      Test the emptiness of the intersection with a given BitSet
      Parameters:
      bs - the BitSet to test the intersection with
      Returns:
      true if empty, false otherwise
    • countIntersection

      public int countIntersection(BitSet bs)
    • toString

      public String toString()
      Overrides:
      toString in class Object