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.
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.
-
Feldübersicht
-
Konstruktorübersicht
KonstruktorBeschreibungDefault constructor initializes the vertex with default values.MarkedVertex
(int xCord, int yCord, String name, T t, Color color) Constructor initializes the vertex with coordinates, name, marking, and color.MarkedVertex
(String s, T t) Constructor initializes the vertex with a name and marking. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungint[]
getCords()
Gets the coordinates of the vertex.Gets the marking of the vertex.Gets the screen vertex used for visualization.void
setCords
(int[] cords) Sets the coordinates of the vertex and updates the screen vertex's position.void
setMarking
(T t) Sets the marking of the vertex.toString()
Returns a string representation of the MarkedVertex.
-
Felddetails
-
marking
-
xCord
private int xCord -
yCord
private int yCord -
screenVertex
-
-
Konstruktordetails
-
MarkedVertex
public MarkedVertex()Default constructor initializes the vertex with default values. -
MarkedVertex
Constructor initializes the vertex with a name and marking.- Parameter:
s
- The name of the vertex.t
- The marking of the vertex.
-
MarkedVertex
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
Gets the marking of the vertex.- Gibt zurück:
- The marking of the vertex.
-
getScreenVertex
Gets the screen vertex used for visualization.- Angegeben von:
getScreenVertex
in KlasseVertex
- 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
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
Returns a string representation of the MarkedVertex.
-