Class SingleSetSignature<T>

java.lang.Object
org.tweetyproject.commons.SingleSetSignature<T>
Type Parameters:
T - The type of formulas in this signature.
All Implemented Interfaces:
Cloneable, Iterable<T>, Signature
Direct Known Subclasses:
DungSignature, PlSignature, SetAfSignature

public abstract class SingleSetSignature<T> extends Object implements Signature, Iterable<T>
This class models a signature as a set of formulas.
Author:
Matthias Thimm, Anna Gessler
  • Constructor Details

    • SingleSetSignature

      public SingleSetSignature()
      Creates a new empty signature.
    • SingleSetSignature

      public SingleSetSignature(Set<T> formulas)
      Creates a new signature with the given set of elements.
      Parameters:
      formulas - set of formulas
  • Method Details

    • isSubSignature

      public boolean isSubSignature(Signature other)
      Description copied from interface: Signature
      Checks 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:
      isSubSignature in interface Signature
      Parameters:
      other - a signature.
      Returns:
      "true" iff this signature is a sub-signature of the given one.
    • isOverlappingSignature

      public boolean isOverlappingSignature(Signature other)
      Description copied from interface: Signature
      Checks 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:
      isOverlappingSignature in interface Signature
      Parameters:
      other - a signature.
      Returns:
      "true" iff this signature is overlapping with the given one.
    • addSignature

      public void addSignature(Signature other)
      Description copied from interface: Signature
      Adds the elements of the given signature to this signature.
      Specified by:
      addSignature in interface Signature
      Parameters:
      other - a signature.
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Signature
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface Signature
      Overrides:
      equals in class Object
    • addAll

      public void addAll(Collection<?> c)
      Description copied from interface: Signature
      Adds all elements of this collection to this signature.
      Specified by:
      addAll in interface Signature
      Parameters:
      c - a collection
    • add

      public void add(Object... objects) throws IllegalArgumentException
      Description copied from interface: Signature
      Adds the given formulas to the signature.
      Specified by:
      add in interface Signature
      Parameters:
      objects - some objects to be added
      Throws:
      IllegalArgumentException
    • remove

      public void remove(Object o)
      Description copied from interface: Signature
      Removes the given formula from this signature, if it is present (optional operation).
      Specified by:
      remove in interface Signature
      Parameters:
      o - some object
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: Signature
      Returns true if this signature is empty.
      Specified by:
      isEmpty in interface Signature
      Returns:
      true if this signature is empty.
    • removeAll

      public void removeAll(Collection<?> c)
      Description copied from interface: Signature
      Removes 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.
      Specified by:
      removeAll in interface Signature
      Parameters:
      c - a collection of objects
    • retainAll

      public void retainAll(Collection<?> c)
      retainAll
      Parameters:
      c - Collection
    • clear

      public void clear()
      Description copied from interface: Signature
      Removes all elements of this signature. After this call returns, this signature will contain no elements.
      Specified by:
      clear in interface Signature
    • iterator

      public Iterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T>
    • toString

      public String toString()
      Specified by:
      toString in interface Signature
      Overrides:
      toString in class Object
    • size

      public 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
    • contains

      public 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
    • containsAll

      public boolean containsAll(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
    • toArray

      public Object[] toArray()
      Returns an array containing all of the elements in this signature.
      Returns:
      signature as array
    • toCollection

      public Collection<T> toCollection()
      Returns a collection containing all of the elements in this signature.
      Returns:
      formulas of this signature
    • clone

      public abstract SingleSetSignature<T> clone()
      Description copied from interface: Signature
      clones signature
      Specified by:
      clone in interface Signature
      Returns:
      clone