Interface AbstractDialecticalFramework
public interface AbstractDialecticalFramework
The implementing subtypes must ensure the following properties:
- Immutability
- All methods return a non-null value if its parameters, e.g. arguments, are from this ADF
- If a method returns a collection or stream, all its elements are non-null
AbstractDialecticalFramework
implementations
more convenient to the user, since it avoids unnecessary nullchecks and
therefore leads to more readable code. Immutability should lead to more
robust code, since an ADF always remains in a valid state after creation. It
makes it also easier to use in a parallel context.- Author:
- Mathias Hofer
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
bipolar()
Checks if the ADF is bipolar.builder()
boolean
static AbstractDialecticalFramework
empty()
static AbstractDialecticalFramework
fromMap(Map<Argument,AcceptanceCondition> map)
getAcceptanceCondition(Argument argument)
Guaranteed to be non-null if the ADF contains the argument.int
incomingDegree(Argument arg)
int
kBipolar()
Returns the count k of non-bipolar links, which makes this ADF k-bipolar.Computes the link (parent, child) iff necessary and returns it afterwards.links()
If the caller just consumes some of the links, the methodlinksStream()
should be preferred to this one.If the caller just consumes some links, this method should be used.int
outgoingDegree(Argument arg)
default SemanticsStep
query()
default int
size()
transform(BiFunction<Argument,AcceptanceCondition,AcceptanceCondition> transformer)
transform(Function<AcceptanceCondition,AcceptanceCondition> transformer)
Creates a newAbstractDialecticalFramework
with transformed acceptance conditions.transform(Transformer<AcceptanceCondition> transformer)
Creates a newAbstractDialecticalFramework
with transformed acceptance conditions.
-
Method Details
-
empty
-
builder
-
fromFile
- Throws:
FileNotFoundException
IOException
-
fromMap
-
transform
AbstractDialecticalFramework transform(Function<AcceptanceCondition,AcceptanceCondition> transformer)Creates a newAbstractDialecticalFramework
with transformed acceptance conditions.- Parameters:
transformer
- the transformer to use- Returns:
- a new ADF with transformed acceptance conditions
-
transform
AbstractDialecticalFramework transform(BiFunction<Argument,AcceptanceCondition,AcceptanceCondition> transformer) -
transform
Creates a newAbstractDialecticalFramework
with transformed acceptance conditions.- Parameters:
transformer
- the transformer to use- Returns:
- a new ADF with transformed acceptance conditions
-
query
-
size
default int size() -
getArguments
- Returns:
- an unmodifiable set of all the arguments
-
linksStream
If the caller just consumes some links, this method should be used. Depending on the implementation, the links may be computed lazily and therefore we may avoid unnecessary computation.- Returns:
- a stream of the links of this adf
-
links
If the caller just consumes some of the links, the methodlinksStream()
should be preferred to this one. Depending on the implementation, the links may be computed lazily and therefore we may avoid unnecessary computation.- Returns:
- an unmodifiable set of all the links
-
link
Computes the link (parent, child) iff necessary and returns it afterwards.- Parameters:
parent
- the parentchild
- the child- Returns:
- the link (parent, child)
- Throws:
IllegalArgumentException
- if the adf does not contain a link (parent, child)
-
linksTo
- Parameters:
child
- the child- Returns:
- a set of links (parent, child)
-
linksFrom
- Parameters:
parent
- the parent- Returns:
- a set of links (parent, child)
-
parents
-
children
-
outgoingDegree
-
incomingDegree
-
contains
-
getAcceptanceCondition
Guaranteed to be non-null if the ADF contains the argument.- Parameters:
argument
- some argument of this ADF- Returns:
- the found acceptance condition, never
null
- Throws:
IllegalArgumentException
- if the argument is not contained in the ADF
-
bipolar
default boolean bipolar()Checks if the ADF is bipolar. May compute all links to do so.- Returns:
- true iff all of the links are bipolar
-
kBipolar
int kBipolar()Returns the count k of non-bipolar links, which makes this ADF k-bipolar.- Returns:
- k
-