ProjektGraph/graph/VertexMarking.java

62 lines
1.2 KiB
Java
Raw Normal View History

2024-06-15 14:48:28 +00:00
package graph;
2024-07-07 21:07:56 +00:00
/**
* Represents a marking associated with a vertex in a graph.
* This class serves as a base abstraction for vertex markings.
*/
2024-06-15 14:48:28 +00:00
public abstract class VertexMarking extends Marking {
2024-07-07 21:07:56 +00:00
// This class currently does not have any additional attributes or methods.
// It extends Marking, inheriting its properties and behaviors.
2024-06-15 14:48:28 +00:00
}
2024-07-07 21:07:56 +00:00
/**
* Represents a weight marking associated with a vertex in a graph.
* Extends {@link VertexMarking}.
*/
class VertexWeightMarking extends VertexMarking {
// ATTRIBUTE
private int weight;
2024-07-07 21:07:56 +00:00
// KONSTRUKTOREN
/**
* Constructs a vertex weight marking with the specified weight.
*
* @param weight The weight value associated with the vertex.
*/
VertexWeightMarking(int weight) {
this.weight = weight;
}
2024-07-07 21:07:56 +00:00
// GET-ER
/**
* Retrieves the weight associated with this vertex weight marking.
*
* @return The weight of the vertex marking.
*/
public int getWeight() {
return this.weight;
}
2024-07-07 21:07:56 +00:00
// 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;
}
}