Class ArgumentSet

java.lang.Object
org.tweetyproject.arg.bipolar.syntax.ArgumentSet
All Implemented Interfaces:
Comparable<ArgumentSet>, Iterable<BArgument>, Collection<BArgument>, BipolarEntity, DungEntity, Formula, Node

public class ArgumentSet extends Object implements BipolarEntity, Collection<BArgument>, Comparable<ArgumentSet>
This class models a set of arguments used in the context of bipolar abstract argumentation theory.

It provides functionalities for managing a collection of BArgument objects, including adding, removing, and comparing sets of arguments. The class implements the BipolarEntity interface, the Collection interface for managing arguments, and the Comparable interface for comparing argument sets.

Author:
Lars Bengel
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs an empty ArgumentSet.
    ArgumentSet(Collection<? extends BArgument> arguments)
    Constructs an ArgumentSet initialized with a collection of arguments.
    Constructs an ArgumentSet with a single argument.
    Constructs an ArgumentSet and initializes it with the arguments from a given Extension<DungTheory>.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    add(BArgument arg0)
    Adds an argument to this set.
    boolean
    addAll(Collection<? extends BArgument> arg0)
    Adds a collection of arguments to this set.
    void
    Clears the set, removing all arguments.
    int
    Compares this ArgumentSet with another for order.
    boolean
    Returns true if this set contains the specified argument.
    boolean
    Returns true if this set contains all of the elements in the specified collection.
    boolean
    Compares this ArgumentSet to another object for equality.
    Returns the set of arguments contained in this ArgumentSet.
    Retrieves the LdoFormula associated with this argument set.
    Retrieves the signature of this argument set.
    int
    Returns the hash code value for this argument set.
    boolean
    Returns true if this set contains no arguments.
    Returns an iterator over the arguments in this set.
    boolean
    remove(Object arg0)
    Removes the specified argument from this set if it is present.
    boolean
    Removes from this set all of its elements that are contained in the specified collection.
    boolean
    Retains only the elements in this set that are contained in the specified collection.
    int
    Returns the number of arguments in this set.
    Returns an array containing all the arguments in this set.
    <T> T[]
    toArray(T[] arg0)
    Returns an array containing all the arguments in this set; the runtime type of the returned array is that of the specified array.
    Returns a string representation of the ArgumentSet.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.util.Collection

    parallelStream, removeIf, spliterator, stream, toArray

    Methods inherited from interface java.lang.Iterable

    forEach
  • Constructor Details

    • ArgumentSet

      public ArgumentSet()
      Constructs an empty ArgumentSet.
    • ArgumentSet

      public ArgumentSet(Extension<DungTheory> ext)
      Constructs an ArgumentSet and initializes it with the arguments from a given Extension<DungTheory>.
      Parameters:
      ext - the extension containing arguments to initialize the set
    • ArgumentSet

      public ArgumentSet(BArgument argument)
      Constructs an ArgumentSet with a single argument.
      Parameters:
      argument - the argument to add to the set
    • ArgumentSet

      public ArgumentSet(Collection<? extends BArgument> arguments)
      Constructs an ArgumentSet initialized with a collection of arguments.
      Parameters:
      arguments - the collection of arguments to initialize the set
  • Method Details

    • toString

      public String toString()
      Returns a string representation of the ArgumentSet. The arguments are enclosed in curly braces and separated by commas.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the argument set
    • hashCode

      public int hashCode()
      Returns the hash code value for this argument set.
      Specified by:
      hashCode in interface Collection<BArgument>
      Overrides:
      hashCode in class Object
      Returns:
      the hash code value
    • equals

      public boolean equals(Object obj)
      Compares this ArgumentSet to another object for equality.
      Specified by:
      equals in interface Collection<BArgument>
      Overrides:
      equals in class Object
      Parameters:
      obj - the object to compare with
      Returns:
      true if the argument sets are equal, false otherwise
    • getArguments

      public Set<BArgument> getArguments()
      Returns the set of arguments contained in this ArgumentSet.
      Returns:
      the set of arguments
    • add

      public boolean add(BArgument arg0)
      Adds an argument to this set.
      Specified by:
      add in interface Collection<BArgument>
      Parameters:
      arg0 - the argument to be added
      Returns:
      true if the set did not already contain the argument
    • addAll

      public boolean addAll(Collection<? extends BArgument> arg0)
      Adds a collection of arguments to this set.
      Specified by:
      addAll in interface Collection<BArgument>
      Parameters:
      arg0 - the collection of arguments to be added
      Returns:
      true if the set changed as a result of the call
    • clear

      public void clear()
      Clears the set, removing all arguments.
      Specified by:
      clear in interface Collection<BArgument>
    • contains

      public boolean contains(Object arg0)
      Returns true if this set contains the specified argument.
      Specified by:
      contains in interface BipolarEntity
      Specified by:
      contains in interface Collection<BArgument>
      Parameters:
      arg0 - the argument to check for containment
      Returns:
      true if this set contains the specified argument
    • containsAll

      public boolean containsAll(Collection<?> arg0)
      Returns true if this set contains all of the elements in the specified collection.
      Specified by:
      containsAll in interface Collection<BArgument>
      Parameters:
      arg0 - the collection to check for containment
      Returns:
      true if this set contains all of the elements in the specified collection
    • isEmpty

      public boolean isEmpty()
      Returns true if this set contains no arguments.
      Specified by:
      isEmpty in interface Collection<BArgument>
      Returns:
      true if this set contains no arguments
    • iterator

      public Iterator<BArgument> iterator()
      Returns an iterator over the arguments in this set.
      Specified by:
      iterator in interface Collection<BArgument>
      Specified by:
      iterator in interface Iterable<BArgument>
      Returns:
      an iterator over the arguments in this set
    • remove

      public boolean remove(Object arg0)
      Removes the specified argument from this set if it is present.
      Specified by:
      remove in interface Collection<BArgument>
      Parameters:
      arg0 - the argument to be removed
      Returns:
      true if the set contained the specified argument
    • removeAll

      public boolean removeAll(Collection<?> arg0)
      Removes from this set all of its elements that are contained in the specified collection.
      Specified by:
      removeAll in interface Collection<BArgument>
      Parameters:
      arg0 - the collection of elements to be removed from this set
      Returns:
      true if the set changed as a result of the call
    • retainAll

      public boolean retainAll(Collection<?> arg0)
      Retains only the elements in this set that are contained in the specified collection.
      Specified by:
      retainAll in interface Collection<BArgument>
      Parameters:
      arg0 - the collection containing elements to be retained in this set
      Returns:
      true if the set changed as a result of the call
    • size

      public int size()
      Returns the number of arguments in this set.
      Specified by:
      size in interface Collection<BArgument>
      Returns:
      the number of arguments in this set
    • toArray

      public Object[] toArray()
      Returns an array containing all the arguments in this set.
      Specified by:
      toArray in interface Collection<BArgument>
      Returns:
      an array containing all the arguments in this set
    • toArray

      public <T> T[] toArray(T[] arg0)
      Returns an array containing all the arguments in this set; the runtime type of the returned array is that of the specified array.
      Specified by:
      toArray in interface Collection<BArgument>
      Type Parameters:
      T - the component type of the array to contain the arguments
      Parameters:
      arg0 - the array into which the arguments of this set are to be stored
      Returns:
      an array containing the arguments in this set
    • compareTo

      public int compareTo(ArgumentSet arg0)
      Compares this ArgumentSet with another for order. The comparison is based on the hash codes of the sets.
      Specified by:
      compareTo in interface Comparable<ArgumentSet>
      Parameters:
      arg0 - the other ArgumentSet to be compared
      Returns:
      a negative integer, zero, or a positive integer as this set is less than, equal to, or greater than the specified set
    • getLdoFormula

      public LdoFormula getLdoFormula()
      Retrieves the LdoFormula associated with this argument set.
      Specified by:
      getLdoFormula in interface DungEntity
      Returns:
      null as this implementation does not currently support LdoFormula
    • getSignature

      public Signature getSignature()
      Retrieves the signature of this argument set.
      Specified by:
      getSignature in interface Formula
      Returns:
      null as this implementation does not currently support signatures