Package org.tweetyproject.commons
Class InterpretationSet<T extends Formula,B extends BeliefBase,S extends Formula>
java.lang.Object
org.tweetyproject.commons.AbstractInterpretation<B,S>
org.tweetyproject.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:
Iterable<T>
,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 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
ConstructorDescriptionCreates a new empty interpretation.InterpretationSet
(Collection<? extends T> formulas) Creates a new interpretation with the given collection of formulas. -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
Adds the specified elements to the end of this collection (optional operation).boolean
addAll
(Collection<? extends T> c) void
clear()
boolean
boolean
containsAll
(Collection<?> c) boolean
int
hashCode()
boolean
isEmpty()
iterator()
boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
Object[]
toArray()
<R> R[]
toArray
(R[] a) toString()
Methods inherited from class org.tweetyproject.commons.AbstractInterpretation
satisfies
Methods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
Methods inherited from interface org.tweetyproject.commons.Interpretation
satisfies, satisfies
-
Constructor Details
-
InterpretationSet
public InterpretationSet()Creates a new empty interpretation. -
InterpretationSet
Creates a new interpretation with the given collection of formulas.- Parameters:
formulas
- a collection of formulas
-
-
Method Details
-
add
- Specified by:
add
in interfaceCollection<T extends Formula>
-
addAll
- Specified by:
addAll
in interfaceCollection<T extends Formula>
-
add
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
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<T extends Formula>
-
contains
- Specified by:
contains
in interfaceCollection<T extends Formula>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<T extends Formula>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<T extends Formula>
-
iterator
-
remove
- Specified by:
remove
in interfaceCollection<T extends Formula>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<T extends Formula>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<T extends Formula>
-
size
public int size()- Specified by:
size
in interfaceCollection<T extends Formula>
-
toArray
- Specified by:
toArray
in interfaceCollection<T extends Formula>
-
toArray
public <R> R[] toArray(R[] a) - Specified by:
toArray
in interfaceCollection<T extends Formula>
-
hashCode
-
equals
-
toString
-