Package net.sf.tweety.commons
Class SingleSetSignature<T>
- java.lang.Object
- 
- net.sf.tweety.commons.SingleSetSignature<T>
 
- 
- Type Parameters:
- T- The type of formulas in this signature.
 - All Implemented Interfaces:
- java.lang.Cloneable,- java.lang.Iterable<T>,- Signature
 - Direct Known Subclasses:
- AbstractDialecticalFramework.Signature,- DungSignature,- PlSignature
 
 public abstract class SingleSetSignature<T> extends java.lang.Object implements Signature, java.lang.Iterable<T> This class models a signature as a set of formulas.- Author:
- Matthias Thimm, Anna Gessler
 
- 
- 
Constructor SummaryConstructors Constructor Description SingleSetSignature()Creates a new empty signature.SingleSetSignature(java.util.Set<T> formulas)Creates a new signature with the given set of elements.
 - 
Method SummaryModifier and Type Method Description voidadd(java.lang.Object... objects)Adds the given formulas to the signature.voidaddAll(java.util.Collection<?> c)Adds all elements of this collection to this signature.voidaddSignature(Signature other)Adds the elements of the given signature to this signature.voidclear()Removes all elements of this signature.abstract SingleSetSignature<T>clone()booleancontains(T f)Returns true if this signature contains the specified formula.booleancontainsAll(java.util.Collection<T> c)Returns true if this signature contains all of the elements in the specified collection.booleanequals(java.lang.Object obj)inthashCode()booleanisEmpty()Returns true if this signature is empty.booleanisOverlappingSignature(Signature other)Checks whether this signature has common elements with the given signature, i.e.booleanisSubSignature(Signature other)Checks whether this signature is a sub-signature of the given signature, i.e.java.util.Iterator<T>iterator()voidremove(java.lang.Object o)Removes the given formula from this signature, if it is present (optional operation).voidremoveAll(java.util.Collection<?> c)Removes all of this signature elements that are also contained in the specified collection (optional operation).voidretainAll(java.util.Collection<?> c)intsize()Returns the number of elements in this signature, i.e.java.lang.Object[]toArray()Returns an array containing all of the elements in this signature.java.util.Collection<T>toCollection()Returns a collection containing all of the elements in this signature.java.lang.StringtoString()
 
- 
- 
- 
Constructor Detail- 
SingleSetSignaturepublic SingleSetSignature() Creates a new empty signature.
 - 
SingleSetSignaturepublic SingleSetSignature(java.util.Set<T> formulas) Creates a new signature with the given set of elements.- Parameters:
- formulas- set of formulas
 
 
- 
 - 
Method Detail- 
isSubSignaturepublic boolean isSubSignature(Signature other) Description copied from interface:SignatureChecks whether this signature is a sub-signature of the given signature, i.e. whether each logical expression expressible with this signature is also expressible with the given signature.- Specified by:
- isSubSignaturein interface- Signature
- Parameters:
- other- a signature.
- Returns:
- "true" iff this signature is a sub-signature of the given one.
 
 - 
isOverlappingSignaturepublic boolean isOverlappingSignature(Signature other) Description copied from interface:SignatureChecks whether this signature has common elements with the given signature, i.e. whether there are logical expressions expressible with this signature that are also expressible with the given signature.- Specified by:
- isOverlappingSignaturein interface- Signature
- Parameters:
- other- a signature.
- Returns:
- "true" iff this signature is overlapping with the given one.
 
 - 
addSignaturepublic void addSignature(Signature other) Description copied from interface:SignatureAdds the elements of the given signature to this signature.- Specified by:
- addSignaturein interface- Signature
- Parameters:
- other- a signature.
 
 - 
hashCodepublic int hashCode() 
 - 
equalspublic boolean equals(java.lang.Object obj) 
 - 
addAllpublic void addAll(java.util.Collection<?> c) Description copied from interface:SignatureAdds all elements of this collection to this signature.
 - 
addpublic void add(java.lang.Object... objects) throws java.lang.IllegalArgumentExceptionDescription copied from interface:SignatureAdds the given formulas to the signature.
 - 
removepublic void remove(java.lang.Object o) Description copied from interface:SignatureRemoves the given formula from this signature, if it is present (optional operation).
 - 
isEmptypublic boolean isEmpty() Description copied from interface:SignatureReturns true if this signature is empty.
 - 
removeAllpublic void removeAll(java.util.Collection<?> c) Description copied from interface:SignatureRemoves all of this signature elements that are also contained in the specified collection (optional operation). After this call returns, this signature will contain no elements in common with the specified collection.
 - 
retainAllpublic void retainAll(java.util.Collection<?> c) 
 - 
clearpublic void clear() Description copied from interface:SignatureRemoves all elements of this signature. After this call returns, this signature will contain no elements.
 - 
iteratorpublic java.util.Iterator<T> iterator() - Specified by:
- iteratorin interface- java.lang.Iterable<T>
 
 - 
toStringpublic java.lang.String toString() 
 - 
sizepublic int size() Returns the number of elements in this signature, i.e. the the size of the set that represents the signature.- Returns:
- size of the signature
 
 - 
containspublic boolean contains(T f) Returns true if this signature contains the specified formula.- Parameters:
- f- a formula
- Returns:
- true if the signature contains f, false otherwise
 
 - 
containsAllpublic boolean containsAll(java.util.Collection<T> c) Returns true if this signature contains all of the elements in the specified collection.- Parameters:
- c- collection of formulas
- Returns:
- true if the signature contains c, false otherwise
 
 - 
toArraypublic java.lang.Object[] toArray() Returns an array containing all of the elements in this signature.- Returns:
- signature as array
 
 - 
toCollectionpublic java.util.Collection<T> toCollection() Returns a collection containing all of the elements in this signature.- Returns:
- formulas of this signature
 
 - 
clonepublic abstract SingleSetSignature<T> clone() 
 
- 
 
-