Interface AbstractDialecticalFramework

  • All Superinterfaces:
    BeliefBase
    All Known Implementing Classes:
    ExtendedAbstractDialecticalFramework, GraphAbstractDialecticalFramework

    public interface AbstractDialecticalFramework
    extends BeliefBase
    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
    This makes the usage of 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
    • Method Detail

      • size

        default int size()
      • getArguments

        java.util.Set<Argument> getArguments()
        Returns:
        an unmodifiable set of all the arguments
      • linksStream

        default java.util.stream.Stream<Link> 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

        java.util.Set<Link> links()
        If the caller just consumes some of the links, the method linksStream() 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

        Link link​(Argument parent,
                  Argument child)
        Computes the link (parent, child) iff necessary and returns it afterwards.
        Parameters:
        parent - the parent
        child - the child
        Returns:
        the link (parent, child)
        Throws:
        java.lang.IllegalArgumentException - if the adf does not contain a link (parent, child)
      • linksTo

        java.util.Set<Link> linksTo​(Argument child)
        Parameters:
        child - the child
        Returns:
        a set of links (parent, child)
      • linksFrom

        java.util.Set<Link> linksFrom​(Argument parent)
        Parameters:
        parent - the parent
        Returns:
        a set of links (parent, child)
      • outgoingDegree

        int outgoingDegree​(Argument arg)
      • incomingDegree

        int incomingDegree​(Argument arg)
      • contains

        boolean contains​(Argument arg)
      • getAcceptanceCondition

        AcceptanceCondition getAcceptanceCondition​(Argument argument)
        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:
        java.lang.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