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
ConstructorDescriptionConstructs an emptyArgumentSet
.ArgumentSet
(Collection<? extends BArgument> arguments) Constructs anArgumentSet
initialized with a collection of arguments.ArgumentSet
(BArgument argument) Constructs anArgumentSet
with a single argument.ArgumentSet
(Extension<DungTheory> ext) Constructs anArgumentSet
and initializes it with the arguments from a givenExtension<DungTheory>
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds an argument to this set.boolean
addAll
(Collection<? extends BArgument> arg0) Adds a collection of arguments to this set.void
clear()
Clears the set, removing all arguments.int
compareTo
(ArgumentSet arg0) Compares thisArgumentSet
with another for order.boolean
Returnstrue
if this set contains the specified argument.boolean
containsAll
(Collection<?> arg0) Returnstrue
if this set contains all of the elements in the specified collection.boolean
Compares thisArgumentSet
to another object for equality.Returns the set of arguments contained in thisArgumentSet
.Retrieves the LdoFormula associated with this argument set.Retrieves the signature of this argument set.int
hashCode()
Returns the hash code value for this argument set.boolean
isEmpty()
Returnstrue
if this set contains no arguments.iterator()
Returns an iterator over the arguments in this set.boolean
Removes the specified argument from this set if it is present.boolean
removeAll
(Collection<?> arg0) Removes from this set all of its elements that are contained in the specified collection.boolean
retainAll
(Collection<?> arg0) Retains only the elements in this set that are contained in the specified collection.int
size()
Returns the number of arguments in this set.Object[]
toArray()
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.toString()
Returns a string representation of theArgumentSet
.Methods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
Constructor Details
-
ArgumentSet
public ArgumentSet()Constructs an emptyArgumentSet
. -
ArgumentSet
Constructs anArgumentSet
and initializes it with the arguments from a givenExtension<DungTheory>
.- Parameters:
ext
- the extension containing arguments to initialize the set
-
ArgumentSet
Constructs anArgumentSet
with a single argument.- Parameters:
argument
- the argument to add to the set
-
ArgumentSet
Constructs anArgumentSet
initialized with a collection of arguments.- Parameters:
arguments
- the collection of arguments to initialize the set
-
-
Method Details
-
toString
-
hashCode
public int hashCode()Returns the hash code value for this argument set.- Specified by:
hashCode
in interfaceCollection<BArgument>
- Overrides:
hashCode
in classObject
- Returns:
- the hash code value
-
equals
-
getArguments
-
add
Adds an argument to this set.- Specified by:
add
in interfaceCollection<BArgument>
- Parameters:
arg0
- the argument to be added- Returns:
true
if the set did not already contain the argument
-
addAll
Adds a collection of arguments to this set.- Specified by:
addAll
in interfaceCollection<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 interfaceCollection<BArgument>
-
contains
Returnstrue
if this set contains the specified argument.- Specified by:
contains
in interfaceBipolarEntity
- Specified by:
contains
in interfaceCollection<BArgument>
- Parameters:
arg0
- the argument to check for containment- Returns:
true
if this set contains the specified argument
-
containsAll
Returnstrue
if this set contains all of the elements in the specified collection.- Specified by:
containsAll
in interfaceCollection<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()Returnstrue
if this set contains no arguments.- Specified by:
isEmpty
in interfaceCollection<BArgument>
- Returns:
true
if this set contains no arguments
-
iterator
-
remove
Removes the specified argument from this set if it is present.- Specified by:
remove
in interfaceCollection<BArgument>
- Parameters:
arg0
- the argument to be removed- Returns:
true
if the set contained the specified argument
-
removeAll
Removes from this set all of its elements that are contained in the specified collection.- Specified by:
removeAll
in interfaceCollection<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
Retains only the elements in this set that are contained in the specified collection.- Specified by:
retainAll
in interfaceCollection<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 interfaceCollection<BArgument>
- Returns:
- the number of arguments in this set
-
toArray
Returns an array containing all the arguments in this set.- Specified by:
toArray
in interfaceCollection<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 interfaceCollection<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
Compares thisArgumentSet
with another for order. The comparison is based on the hash codes of the sets.- Specified by:
compareTo
in interfaceComparable<ArgumentSet>
- Parameters:
arg0
- the otherArgumentSet
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
Retrieves the LdoFormula associated with this argument set.- Specified by:
getLdoFormula
in interfaceDungEntity
- Returns:
null
as this implementation does not currently support LdoFormula
-
getSignature
Retrieves the signature of this argument set.- Specified by:
getSignature
in interfaceFormula
- Returns:
null
as this implementation does not currently support signatures
-