Class InterpretationSet<T extends Formula,​B extends BeliefBase,​S extends Formula>

  • Type Parameters:
    T - The actual class of the formulas stored in this interpretation
    B - The class of belief bases this interpretation can handle
    S - The actual class of formulas this interpretation can handle
    All Implemented Interfaces:
    java.lang.Iterable<T>, java.util.Collection<T>, Interpretation<B,​S>
    Direct Known Subclasses:
    AnswerSet, DlInterpretation, HerbrandInterpretation, MlHerbrandInterpretation, NicePossibleWorld, PossibleWorld

    public abstract class InterpretationSet<T extends Formula,​B extends BeliefBase,​S extends Formula>
    extends AbstractInterpretation<B,​S>
    implements java.util.Collection<T>
    This class models an interpretation that is a set of some formula and as such implements the java.util.Collection interface. This class should be used as ancestor for collection-based interpretations.
    Author:
    Matthias Thimm
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Set<T> formulas
      The set of formulas of this interpretation.
    • Constructor Summary

      Constructors 
      Constructor Description
      InterpretationSet()
      Creates a new empty interpretation.
      InterpretationSet​(java.util.Collection<? extends T> formulas)
      Creates a new interpretation with the given collection of formulas.
    • Method Summary

      Modifier and Type Method Description
      boolean add​(T e)  
      boolean addAll​(java.util.Collection<? extends T> c)  
      void clear()  
      boolean contains​(java.lang.Object o)  
      boolean containsAll​(java.util.Collection<?> c)  
      boolean equals​(java.lang.Object obj)  
      int hashCode()  
      boolean isEmpty()  
      java.util.Iterator<T> iterator()  
      boolean remove​(java.lang.Object o)  
      boolean removeAll​(java.util.Collection<?> c)  
      boolean retainAll​(java.util.Collection<?> c)  
      int size()  
      java.lang.Object[] toArray()  
      <R> R[] toArray​(R[] a)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, spliterator, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
    • Field Detail

      • formulas

        private java.util.Set<T extends Formula> formulas
        The set of formulas of this interpretation.
    • Constructor Detail

      • InterpretationSet

        public InterpretationSet()
        Creates a new empty interpretation.
      • InterpretationSet

        public InterpretationSet​(java.util.Collection<? extends T> formulas)
        Creates a new interpretation with the given collection of formulas.
        Parameters:
        formulas - a collection of formulas
    • Method Detail

      • add

        public boolean add​(T e)
        Specified by:
        add in interface java.util.Collection<T extends Formula>
      • addAll

        public boolean addAll​(java.util.Collection<? extends T> c)
        Specified by:
        addAll in interface java.util.Collection<T extends Formula>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<T extends Formula>
      • contains

        public boolean contains​(java.lang.Object o)
        Specified by:
        contains in interface java.util.Collection<T extends Formula>
      • containsAll

        public boolean containsAll​(java.util.Collection<?> c)
        Specified by:
        containsAll in interface java.util.Collection<T extends Formula>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection<T extends Formula>
      • iterator

        public java.util.Iterator<T> iterator()
        Specified by:
        iterator in interface java.util.Collection<T extends Formula>
        Specified by:
        iterator in interface java.lang.Iterable<T extends Formula>
      • remove

        public boolean remove​(java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection<T extends Formula>
      • removeAll

        public boolean removeAll​(java.util.Collection<?> c)
        Specified by:
        removeAll in interface java.util.Collection<T extends Formula>
      • retainAll

        public boolean retainAll​(java.util.Collection<?> c)
        Specified by:
        retainAll in interface java.util.Collection<T extends Formula>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<T extends Formula>
      • toArray

        public java.lang.Object[] toArray()
        Specified by:
        toArray in interface java.util.Collection<T extends Formula>
      • toArray

        public <R> R[] toArray​(R[] a)
        Specified by:
        toArray in interface java.util.Collection<T extends Formula>
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Collection<T extends Formula>
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in interface java.util.Collection<T extends Formula>
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object