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,net.sf.tweety.commons.BeliefBase
public final class ExtendedAbstractDialecticalFramework extends Object implements AbstractDialecticalFramework
Extended in the sense of the addition of arguments and links to an existing ADF. Since theAbstractDialecticalFrameworkcontract 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 Set<Argument>children(Argument parent)booleancontains(Argument arg)AcceptanceConditiongetAcceptanceCondition(Argument argument)Guaranteed to be non-null if the ADF contains the argument.Set<Argument>getArguments()intincomingDegree(Argument arg)intkBipolar()Returns the count k of non-bipolar links, which makes this ADF k-bipolar.Linklink(Argument parent, Argument child)Computes the link (parent, child) iff necessary and returns it afterwards.Set<Link>links()If the caller just consumes some of the links, the methodAbstractDialecticalFramework.linksStream()should be preferred to this one.Set<Link>linksFrom(Argument parent)Stream<Link>linksStream()If the caller just consumes some links, this method should be used.Set<Link>linksTo(Argument child)intoutgoingDegree(Argument arg)Set<Argument>parents(Argument child)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.tweety.arg.adf.syntax.adf.AbstractDialecticalFramework
bipolar, getMinimalSignature, size
-
-
-
-
Method Detail
-
getArguments
public Set<Argument> getArguments()
- Specified by:
getArgumentsin interfaceAbstractDialecticalFramework- Returns:
- an unmodifiable set of all the arguments
-
links
public Set<Link> links()
Description copied from interface:AbstractDialecticalFrameworkIf 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:
linksin interfaceAbstractDialecticalFramework- Returns:
- an unmodifiable set of all the links
-
linksStream
public Stream<Link> linksStream()
Description copied from interface:AbstractDialecticalFrameworkIf 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:
linksStreamin interfaceAbstractDialecticalFramework- Returns:
- a stream of the links of this adf
-
link
public Link link(Argument parent, Argument child)
Description copied from interface:AbstractDialecticalFrameworkComputes the link (parent, child) iff necessary and returns it afterwards.- Specified by:
linkin interfaceAbstractDialecticalFramework- Parameters:
parent- the parentchild- the child- Returns:
- the link (parent, child)
-
linksTo
public Set<Link> linksTo(Argument child)
- Specified by:
linksToin interfaceAbstractDialecticalFramework- Parameters:
child- the child- Returns:
- a set of links (parent, child)
-
linksFrom
public Set<Link> linksFrom(Argument parent)
- Specified by:
linksFromin interfaceAbstractDialecticalFramework- Parameters:
parent- the parent- Returns:
- a set of links (parent, child)
-
parents
public Set<Argument> parents(Argument child)
- Specified by:
parentsin interfaceAbstractDialecticalFramework
-
children
public Set<Argument> children(Argument parent)
- Specified by:
childrenin interfaceAbstractDialecticalFramework
-
contains
public boolean contains(Argument arg)
- Specified by:
containsin interfaceAbstractDialecticalFramework
-
getAcceptanceCondition
public AcceptanceCondition getAcceptanceCondition(Argument argument)
Description copied from interface:AbstractDialecticalFrameworkGuaranteed to be non-null if the ADF contains the argument.- Specified by:
getAcceptanceConditionin interfaceAbstractDialecticalFramework- Parameters:
argument- some argument of this ADF- Returns:
- the found acceptance condition, never
null
-
kBipolar
public int kBipolar()
Description copied from interface:AbstractDialecticalFrameworkReturns the count k of non-bipolar links, which makes this ADF k-bipolar.- Specified by:
kBipolarin interfaceAbstractDialecticalFramework- Returns:
- k
-
incomingDegree
public int incomingDegree(Argument arg)
- Specified by:
incomingDegreein interfaceAbstractDialecticalFramework
-
outgoingDegree
public int outgoingDegree(Argument arg)
- Specified by:
outgoingDegreein interfaceAbstractDialecticalFramework
-
-