Package graph

Klasse MarkedVertex<T extends VertexMarking>

java.lang.Object
graph.Vertex
graph.MarkedVertex<T>
Typparameter:
T - A type that extends VertexMarking, used for marking the vertex.

public class MarkedVertex<T extends VertexMarking> extends Vertex
The MarkedVertex class extends the Vertex class and includes additional attributes for marking, coordinates, and visualization on a screen. It supports various constructors to initialize these attributes and provides getter and setter methods for accessing and modifying them.
  • Felddetails

    • marking

      private T extends VertexMarking marking
    • xCord

      private int xCord
    • yCord

      private int yCord
    • screenVertex

      private Vertex screenVertex
  • Konstruktordetails

    • MarkedVertex

      public MarkedVertex()
      Default constructor initializes the vertex with default values.
    • MarkedVertex

      public MarkedVertex(String s, T t)
      Constructor initializes the vertex with a name and marking.
      Parameter:
      s - The name of the vertex.
      t - The marking of the vertex.
    • MarkedVertex

      public MarkedVertex(int xCord, int yCord, String name, T t, Color color)
      Constructor initializes the vertex with coordinates, name, marking, and color.
      Parameter:
      xCord - The x-coordinate of the vertex.
      yCord - The y-coordinate of the vertex.
      name - The name of the vertex.
      t - The marking of the vertex.
      color - The color of the vertex for visualization purposes.
  • Methodendetails

    • getMarking

      public T getMarking()
      Gets the marking of the vertex.
      Gibt zurück:
      The marking of the vertex.
    • getScreenVertex

      public Vertex getScreenVertex()
      Gets the screen vertex used for visualization.
      Angegeben von:
      getScreenVertex in Klasse Vertex
      Gibt zurück:
      The screen vertex.
    • getCords

      public int[] getCords()
      Gets the coordinates of the vertex.
      Gibt zurück:
      An array containing the x and y coordinates of the vertex.
    • setMarking

      public void setMarking(T t)
      Sets the marking of the vertex.
      Parameter:
      t - The new marking of the vertex.
    • setCords

      public void setCords(int[] cords)
      Sets the coordinates of the vertex and updates the screen vertex's position.
      Parameter:
      cords - An array containing the new x and y coordinates of the vertex.
    • toString

      public String toString()
      Returns a string representation of the MarkedVertex.
      Setzt außer Kraft:
      toString in Klasse Object
      Gibt zurück:
      A string representing the MarkedVertex.