ProjektGraph/graph/EdgeWeightMarking.java

40 lines
889 B
Java
Raw Normal View History

2024-07-07 21:39:17 +00:00
package graph;
2024-07-07 22:11:04 +00:00
/**
* Class representing a specific type of edge marking: edge weight.
* Inherits from EdgeMarking.
*/
2024-07-07 21:39:17 +00:00
public class EdgeWeightMarking extends EdgeMarking {
2024-07-07 22:11:04 +00:00
/** The weight value associated with this edge marking. */
2024-07-07 21:39:17 +00:00
private int weight;
2024-07-07 22:11:04 +00:00
/**
* Constructor to initialize the EdgeWeightMarking with a specified weight.
*
* @param weight The weight value to set.
*/
public EdgeWeightMarking(int weight) {
2024-07-07 21:39:17 +00:00
this.weight = weight;
}
2024-07-07 22:11:04 +00:00
/**
* Sets the weight value of this edge marking.
*
* @param weight The weight value to set.
*/
public void setWeight(int weight) {
this.weight = weight;
2024-07-07 21:39:17 +00:00
}
2024-07-07 22:11:04 +00:00
/**
* Retrieves the weight value of this edge marking.
*
* @return The weight value of this edge marking.
*/
public int getWeight() {
2024-07-07 21:39:17 +00:00
return this.weight;
}
}