Class BetaMemory.IndexedConstraintMemory

  • Enclosing class:
    BetaMemory

    public static class BetaMemory.IndexedConstraintMemory
    extends java.lang.Object
    A memory for an indexed constraint.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Map objects
      The map for (value -> objects).
      protected java.util.Map ovalues
      The cached values (object -> value).
      protected java.util.Map tuples
      The map for (value -> tuples).
      protected java.util.Map tvalues
      The cached values (tuple -> value).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addObject​(java.lang.Object value, java.lang.Object object)
      Add an object to the memory.
      void addTuple​(java.lang.Object value, Tuple tuple)
      Add a tuple to the memory.
      java.util.Set getObjects​(java.lang.Object value)
      Get object for value.
      java.lang.Object getObjectValue​(java.lang.Object object)
      Get the value for an object.
      java.util.Set getTuples​(java.lang.Object value)
      Get the tuples for a value.
      java.lang.Object getTupleValue​(Tuple tuple)
      Get the value for a tuple.
      void removeObject​(java.lang.Object object)
      Remove an object from the memory.
      void removeTuple​(Tuple tuple)
      Remove a tuple from the memory.
      int size()
      Get the size of the beta memory (including indexed memories).
      java.lang.String toString()
      Create a string representation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • objects

        protected java.util.Map objects
        The map for (value -> objects).
      • tuples

        protected java.util.Map tuples
        The map for (value -> tuples).
      • ovalues

        protected java.util.Map ovalues
        The cached values (object -> value). Required, because objects can change and old value (for removal) can no longer be obtained.
      • tvalues

        protected java.util.Map tvalues
        The cached values (tuple -> value). Required, because objects can change and old value (for removal) can no longer be obtained.
    • Constructor Detail

      • IndexedConstraintMemory

        public IndexedConstraintMemory​(IOAVState state)
        Create a new constraint memory.
    • Method Detail

      • getObjects

        public java.util.Set getObjects​(java.lang.Object value)
        Get object for value.
        Parameters:
        value - The value.
        Returns:
        The objects.
      • getTuples

        public java.util.Set getTuples​(java.lang.Object value)
        Get the tuples for a value.
        Parameters:
        value - The value.
        Returns:
        The tuples.
      • getObjectValue

        public java.lang.Object getObjectValue​(java.lang.Object object)
        Get the value for an object.
        Parameters:
        object - The object.
        Returns:
        The value.
      • getTupleValue

        public java.lang.Object getTupleValue​(Tuple tuple)
        Get the value for a tuple.
        Parameters:
        tuple - The tuple.
        Returns:
        The value.
      • addObject

        public void addObject​(java.lang.Object value,
                              java.lang.Object object)
        Add an object to the memory.
        Parameters:
        value - The index.
        object - The object.
      • removeObject

        public void removeObject​(java.lang.Object object)
        Remove an object from the memory.
        Parameters:
        object - The object.
      • addTuple

        public void addTuple​(java.lang.Object value,
                             Tuple tuple)
        Add a tuple to the memory.
        Parameters:
        value - The index.
        tuple - The object.
      • removeTuple

        public void removeTuple​(Tuple tuple)
        Remove a tuple from the memory.
        Parameters:
        tuple - The tuple.
      • size

        public int size()
        Get the size of the beta memory (including indexed memories).
        Returns:
        The size of the memory.
      • toString

        public java.lang.String toString()
        Create a string representation.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The string representation.