Package graph

Klasse Edge

java.lang.Object
graph.Edge
Bekannte direkte Unterklassen:
MarkedEdge

public abstract class Edge extends Object
Abstract class representing an edge in a graph.
  • Felddetails

    • name

      private String name
      The name of the edge.
    • source

      private Vertex source
      The source vertex of the edge.
    • destination

      private Vertex destination
      The destination vertex of the edge.
  • Konstruktordetails

    • Edge

      public Edge()
      Default constructor initializes the edge with empty name and null source and destination vertices.
    • Edge

      public Edge(String s, Vertex n1, Vertex n2)
      Constructor initializes the edge with a specified name, source, and destination vertices.
      Parameter:
      s - The name of the edge.
      n1 - The source vertex of the edge.
      n2 - The destination vertex of the edge.
  • Methodendetails

    • getName

      public String getName()
      Retrieves the name of the edge.
      Gibt zurück:
      The name of the edge.
    • getSource

      public Vertex getSource()
      Retrieves the source vertex of the edge.
      Gibt zurück:
      The source vertex of the edge.
    • getDestination

      public Vertex getDestination()
      Retrieves the destination vertex of the edge.
      Gibt zurück:
      The destination vertex of the edge.
    • getScreenEdge

      public abstract Edge getScreenEdge()
      Abstract method to retrieve the screen representation of the edge for visualization.
      Gibt zurück:
      The visualizationElements.Edge representing the screen edge.
    • setName

      public void setName(String s)
      Sets the name of the edge.
      Parameter:
      s - The name to set for the edge.
    • setSource

      public void setSource(Vertex n)
      Sets the source vertex of the edge.
      Parameter:
      n - The source vertex to set for the edge.
    • setDestination

      public void setDestination(Vertex n)
      Sets the destination vertex of the edge.
      Parameter:
      n - The destination vertex to set for the edge.