Package net.sf.tweety.commons
Class InterpretationSet<T extends Formula,B extends BeliefBase,S extends Formula>
- java.lang.Object
-
- net.sf.tweety.commons.AbstractInterpretation<B,S>
-
- net.sf.tweety.commons.InterpretationSet<T,B,S>
-
- Type Parameters:
T- The actual class of the formulas stored in this interpretationB- The class of belief bases this interpretation can handleS- 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,QbPossibleWorld
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
-
-
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 booleanadd(T e)booleanadd(T... elements)Adds the specified elements to the end of this collection (optional operation).booleanaddAll(java.util.Collection<? extends T> c)voidclear()booleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> c)booleanequals(java.lang.Object obj)inthashCode()booleanisEmpty()java.util.Iterator<T>iterator()booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> c)booleanretainAll(java.util.Collection<?> c)intsize()java.lang.Object[]toArray()<R> R[]toArray(R[] a)java.lang.StringtoString()-
Methods inherited from class net.sf.tweety.commons.AbstractInterpretation
satisfies
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
Methods inherited from interface net.sf.tweety.commons.Interpretation
satisfies, satisfies
-
-
-
-
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
-
addAll
public boolean addAll(java.util.Collection<? extends T> c)
-
add
public boolean add(T... elements)
Adds the specified elements to the end of this collection (optional operation).- Parameters:
elements- to be appended to collection- Returns:
- true if all elements were added, false otherwise
-
contains
public boolean contains(java.lang.Object o)
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
-
isEmpty
public boolean isEmpty()
-
iterator
public java.util.Iterator<T> iterator()
-
remove
public boolean remove(java.lang.Object o)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <R> R[] toArray(R[] a)
-
hashCode
public int hashCode()
-
equals
public boolean equals(java.lang.Object obj)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-