Class SimpleLink

All Implemented Interfaces:
Link

public final class SimpleLink extends DirectedEdge<Argument> implements Link
A simple immutable representation of ADF links.
Author:
Mathias Hofer, Lars Bengel
  • Constructor Details

    • SimpleLink

      public SimpleLink(Argument from, Argument to, LinkType type)
      Parameters:
      from - the source of the link
      to - the target of the link
      type - the type of the link
    • SimpleLink

      public SimpleLink(Argument from, Argument to)
      Constructs a new SimpleLink with the specified source and target arguments. The link is of type LinkType.DEPENDENT.
      Parameters:
      from - The source argument from which the link originates.
      to - The target argument to which the link points.
      Throws:
      NullPointerException - if either from or to is null.
  • Method Details

    • getFrom

      public Argument getFrom()
      Returns the source argument from which the link originates.
      Specified by:
      getFrom in interface Link
      Returns:
      The source argument.
    • getTo

      public Argument getTo()
      Returns the target argument to which the link points.
      Specified by:
      getTo in interface Link
      Returns:
      The target argument.
    • getType

      public LinkType getType()
      Returns the type of the link, indicating the nature of the connection between the source and target arguments.
      Specified by:
      getType in interface Link
      Returns:
      The link type.
    • toString

      public String toString()
      Overrides:
      toString in class DirectedEdge<Argument>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Edge<Argument>
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Edge<Argument>