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
ConstructorsConstructorDescriptionConstructs an emptyArgumentSet.ArgumentSet(Collection<? extends BArgument> arguments) Constructs anArgumentSetinitialized with a collection of arguments.ArgumentSet(BArgument argument) Constructs anArgumentSetwith a single argument.ArgumentSet(Extension<DungTheory> ext) Constructs anArgumentSetand initializes it with the arguments from a givenExtension<DungTheory>. -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds an argument to this set.booleanaddAll(Collection<? extends BArgument> arg0) Adds a collection of arguments to this set.voidclear()Clears the set, removing all arguments.intcompareTo(ArgumentSet arg0) Compares thisArgumentSetwith another for order.booleanReturnstrueif this set contains the specified argument.booleancontainsAll(Collection<?> arg0) Returnstrueif this set contains all of the elements in the specified collection.booleanCompares thisArgumentSetto 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.inthashCode()Returns the hash code value for this argument set.booleanisEmpty()Returnstrueif this set contains no arguments.iterator()Returns an iterator over the arguments in this set.booleanRemoves the specified argument from this set if it is present.booleanremoveAll(Collection<?> arg0) Removes from this set all of its elements that are contained in the specified collection.booleanretainAll(Collection<?> arg0) Retains only the elements in this set that are contained in the specified collection.intsize()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 anArgumentSetand initializes it with the arguments from a givenExtension<DungTheory>.- Parameters:
ext- the extension containing arguments to initialize the set
-
ArgumentSet
Constructs anArgumentSetwith a single argument.- Parameters:
argument- the argument to add to the set
-
ArgumentSet
Constructs anArgumentSetinitialized 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:
hashCodein interfaceCollection<BArgument>- Overrides:
hashCodein classObject- Returns:
- the hash code value
-
equals
-
getArguments
-
add
Adds an argument to this set.- Specified by:
addin interfaceCollection<BArgument>- Parameters:
arg0- the argument to be added- Returns:
trueif the set did not already contain the argument
-
addAll
Adds a collection of arguments to this set.- Specified by:
addAllin interfaceCollection<BArgument>- Parameters:
arg0- the collection of arguments to be added- Returns:
trueif the set changed as a result of the call
-
clear
public void clear()Clears the set, removing all arguments.- Specified by:
clearin interfaceCollection<BArgument>
-
contains
Returnstrueif this set contains the specified argument.- Specified by:
containsin interfaceBipolarEntity- Specified by:
containsin interfaceCollection<BArgument>- Parameters:
arg0- the argument to check for containment- Returns:
trueif this set contains the specified argument
-
containsAll
Returnstrueif this set contains all of the elements in the specified collection.- Specified by:
containsAllin interfaceCollection<BArgument>- Parameters:
arg0- the collection to check for containment- Returns:
trueif this set contains all of the elements in the specified collection
-
isEmpty
public boolean isEmpty()Returnstrueif this set contains no arguments.- Specified by:
isEmptyin interfaceCollection<BArgument>- Returns:
trueif this set contains no arguments
-
iterator
-
remove
Removes the specified argument from this set if it is present.- Specified by:
removein interfaceCollection<BArgument>- Parameters:
arg0- the argument to be removed- Returns:
trueif the set contained the specified argument
-
removeAll
Removes from this set all of its elements that are contained in the specified collection.- Specified by:
removeAllin interfaceCollection<BArgument>- Parameters:
arg0- the collection of elements to be removed from this set- Returns:
trueif 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:
retainAllin interfaceCollection<BArgument>- Parameters:
arg0- the collection containing elements to be retained in this set- Returns:
trueif the set changed as a result of the call
-
size
public int size()Returns the number of arguments in this set.- Specified by:
sizein interfaceCollection<BArgument>- Returns:
- the number of arguments in this set
-
toArray
Returns an array containing all the arguments in this set.- Specified by:
toArrayin 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:
toArrayin 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 thisArgumentSetwith another for order. The comparison is based on the hash codes of the sets.- Specified by:
compareToin interfaceComparable<ArgumentSet>- Parameters:
arg0- the otherArgumentSetto 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:
getLdoFormulain interfaceDungEntity- Returns:
nullas this implementation does not currently support LdoFormula
-
getSignature
Retrieves the signature of this argument set.- Specified by:
getSignaturein interfaceFormula- Returns:
nullas this implementation does not currently support signatures
-