ProjektGraph/graph/VertexWeightMarking.java

52 lines
951 B
Java
Raw Normal View History

2024-07-08 19:15:24 +00:00
package graph;
/**
* Represents a weight marking associated with a vertex in a graph.
* Extends {@link VertexMarking}.
*/
public class VertexWeightMarking extends VertexMarking {
// ATTRIBUTE
private int weight;
// KONSTRUKTOREN
/**
* Constructs a vertex weight marking with the specified weight.
*
* @param weight The weight value associated with the vertex.
*/
public VertexWeightMarking(int weight) {
this.weight = weight;
}
// GET-ER
/**
* Retrieves the weight associated with this vertex weight marking.
*
* @return The weight of the vertex marking.
*/
public int getWeight() {
return this.weight;
}
// SET-ER
/**
* Sets the weight associated with this vertex weight marking.
*
* @param weight The new weight value to set.
*/
public void setWeight(int weight) {
this.weight = weight;
}
}