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:
Iterable<T>,Collection<T>,Interpretation<B,S>
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
Constructors Constructor Description InterpretationSet()Creates a new empty interpretation.InterpretationSet(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(Collection<? extends T> c)voidclear()booleancontains(Object o)booleancontainsAll(Collection<?> c)booleanequals(Object obj)inthashCode()booleanisEmpty()Iterator<T>iterator()booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)intsize()Object[]toArray()<R> R[]toArray(R[] a)StringtoString()-
Methods inherited from class net.sf.tweety.commons.AbstractInterpretation
satisfies
-
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 net.sf.tweety.commons.Interpretation
satisfies, satisfies
-
-
-
-
Constructor Detail
-
InterpretationSet
public InterpretationSet()
Creates a new empty interpretation.
-
InterpretationSet
public InterpretationSet(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:
addin interfaceCollection<T extends Formula>
-
addAll
public boolean addAll(Collection<? extends T> c)
- Specified by:
addAllin interfaceCollection<T extends Formula>
-
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
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<T extends Formula>
-
contains
public boolean contains(Object o)
- Specified by:
containsin interfaceCollection<T extends Formula>
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<T extends Formula>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection<T extends Formula>
-
remove
public boolean remove(Object o)
- Specified by:
removein interfaceCollection<T extends Formula>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<T extends Formula>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAllin interfaceCollection<T extends Formula>
-
size
public int size()
- Specified by:
sizein interfaceCollection<T extends Formula>
-
toArray
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection<T extends Formula>
-
toArray
public <R> R[] toArray(R[] a)
- Specified by:
toArrayin interfaceCollection<T extends Formula>
-
hashCode
public int hashCode()
-
equals
public boolean equals(Object obj)
-
-