Package net.sf.tweety.arg.adf.syntax.adf
Class ExtendedAbstractDialecticalFramework
- java.lang.Object
-
- net.sf.tweety.arg.adf.syntax.adf.ExtendedAbstractDialecticalFramework
-
- All Implemented Interfaces:
AbstractDialecticalFramework
,BeliefBase
public final class ExtendedAbstractDialecticalFramework extends java.lang.Object implements AbstractDialecticalFramework
Extended in the sense of the addition of arguments and links to an existing ADF. Since theAbstractDialecticalFramework
contract ensures immutability, this implementation basically only stores the delta of the extended ADF. This keeps the memory and computation footprint as low as possible, since we reuse as much as possible and only introduce new references to the delta.- Author:
- Mathias Hofer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.sf.tweety.arg.adf.syntax.adf.AbstractDialecticalFramework
AbstractDialecticalFramework.Builder, AbstractDialecticalFramework.Signature
-
-
Method Summary
Modifier and Type Method Description java.util.Set<Argument>
children(Argument parent)
boolean
contains(Argument arg)
AcceptanceCondition
getAcceptanceCondition(Argument argument)
Guaranteed to be non-null if the ADF contains the argument.java.util.Set<Argument>
getArguments()
int
incomingDegree(Argument arg)
int
kBipolar()
Returns the count k of non-bipolar links, which makes this ADF k-bipolar.Link
link(Argument parent, Argument child)
Computes the link (parent, child) iff necessary and returns it afterwards.java.util.Set<Link>
links()
If the caller just consumes some of the links, the methodAbstractDialecticalFramework.linksStream()
should be preferred to this one.java.util.Set<Link>
linksFrom(Argument parent)
java.util.stream.Stream<Link>
linksStream()
If the caller just consumes some links, this method should be used.java.util.Set<Link>
linksTo(Argument child)
int
outgoingDegree(Argument arg)
java.util.Set<Argument>
parents(Argument child)
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.tweety.arg.adf.syntax.adf.AbstractDialecticalFramework
bipolar, getMinimalSignature, size
-
Methods inherited from interface net.sf.tweety.commons.BeliefBase
toString
-
-
-
-
Method Detail
-
getArguments
public java.util.Set<Argument> getArguments()
- Specified by:
getArguments
in interfaceAbstractDialecticalFramework
- Returns:
- an unmodifiable set of all the arguments
-
links
public java.util.Set<Link> links()
Description copied from interface:AbstractDialecticalFramework
If the caller just consumes some of the links, the methodAbstractDialecticalFramework.linksStream()
should be preferred to this one. Depending on the implementation, the links may be computed lazily and therefore we may avoid unnecessary computation.- Specified by:
links
in interfaceAbstractDialecticalFramework
- Returns:
- an unmodifiable set of all the links
-
linksStream
public java.util.stream.Stream<Link> linksStream()
Description copied from interface:AbstractDialecticalFramework
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.- Specified by:
linksStream
in interfaceAbstractDialecticalFramework
- Returns:
- a stream of the links of this adf
-
link
public Link link(Argument parent, Argument child)
Description copied from interface:AbstractDialecticalFramework
Computes the link (parent, child) iff necessary and returns it afterwards.- Specified by:
link
in interfaceAbstractDialecticalFramework
- Parameters:
parent
- the parentchild
- the child- Returns:
- the link (parent, child)
-
linksTo
public java.util.Set<Link> linksTo(Argument child)
- Specified by:
linksTo
in interfaceAbstractDialecticalFramework
- Parameters:
child
- the child- Returns:
- a set of links (parent, child)
-
linksFrom
public java.util.Set<Link> linksFrom(Argument parent)
- Specified by:
linksFrom
in interfaceAbstractDialecticalFramework
- Parameters:
parent
- the parent- Returns:
- a set of links (parent, child)
-
parents
public java.util.Set<Argument> parents(Argument child)
- Specified by:
parents
in interfaceAbstractDialecticalFramework
-
children
public java.util.Set<Argument> children(Argument parent)
- Specified by:
children
in interfaceAbstractDialecticalFramework
-
contains
public boolean contains(Argument arg)
- Specified by:
contains
in interfaceAbstractDialecticalFramework
-
getAcceptanceCondition
public AcceptanceCondition getAcceptanceCondition(Argument argument)
Description copied from interface:AbstractDialecticalFramework
Guaranteed to be non-null if the ADF contains the argument.- Specified by:
getAcceptanceCondition
in interfaceAbstractDialecticalFramework
- Parameters:
argument
- some argument of this ADF- Returns:
- the found acceptance condition, never
null
-
kBipolar
public int kBipolar()
Description copied from interface:AbstractDialecticalFramework
Returns the count k of non-bipolar links, which makes this ADF k-bipolar.- Specified by:
kBipolar
in interfaceAbstractDialecticalFramework
- Returns:
- k
-
incomingDegree
public int incomingDegree(Argument arg)
- Specified by:
incomingDegree
in interfaceAbstractDialecticalFramework
-
outgoingDegree
public int outgoingDegree(Argument arg)
- Specified by:
outgoingDegree
in interfaceAbstractDialecticalFramework
-
-