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 boolean
add(T e)
boolean
add(T... elements)
Adds the specified elements to the end of this collection (optional operation).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 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:
toString
in classjava.lang.Object
-
-