ProjektGraph/OurApplication/OurLogElement.java

117 lines
3.2 KiB
Java
Raw Normal View History

2024-07-02 19:13:30 +00:00
package OurApplication;
2024-07-02 19:13:30 +00:00
import graph.DirectedGraph;
import graph.EdgeMarking;
import graph.VertexMarking;
import logging.LogElement;
2024-07-03 17:41:46 +00:00
import visualizationElements.Edge;
import visualizationElements.Vertex;
/**
2024-07-08 22:17:31 +00:00
* This class extends logging.LogElement to provide additional functionality
* for logging various elements related to graph visualization.
*
2024-07-02 19:13:30 +00:00
* @see LogElement
*/
2024-07-08 22:17:31 +00:00
public class OurLogElement extends LogElement {
/** The sum up value associated with this log element. */
protected long value;
2024-07-03 17:41:46 +00:00
protected Vertex vertex;
protected Edge edge;
protected visualizationElements.Graph ourGraph;
/**
2024-07-08 22:17:31 +00:00
* Standard constructor.
* Initializes the log element with default values.
*/
2024-07-02 19:13:30 +00:00
public OurLogElement() {
super();
2024-07-03 17:41:46 +00:00
this.value = 0;
}
2024-07-08 22:17:31 +00:00
/**
* Extended constructor.
2024-07-08 22:17:31 +00:00
* Initializes the log element with specified step number, description, sum up value, and vertex.
*
* @param step the step number of the log element
* @param description the description of the log element
* @param value the sum up value associated with the log element
* @param vertex the vertex associated with the log element
*/
2024-07-08 22:17:31 +00:00
public OurLogElement(int step, String description, long value, Vertex vertex) {
2024-07-02 22:46:21 +00:00
this.step = step;
this.description = description;
this.value = value;
2024-07-07 12:02:19 +00:00
this.vertex = vertex;
2024-07-03 17:41:46 +00:00
}
2024-07-08 22:17:31 +00:00
/**
* Extended constructor.
* Initializes the log element with specified step number, description, sum up value, and edge.
*
* @param step the step number of the log element
* @param description the description of the log element
* @param value the sum up value associated with the log element
* @param edge the edge associated with the log element
*/
public OurLogElement(int step, String description, long value, Edge edge) {
2024-07-03 17:41:46 +00:00
this.step = step;
this.description = description;
this.value = value;
2024-07-07 12:02:19 +00:00
this.edge = edge;
}
2024-07-08 22:17:31 +00:00
/**
* Extended constructor.
* Initializes the log element with specified step number, description, sum up value, and graph.
*
* @param step the step number of the log element
* @param description the description of the log element
* @param value the sum up value associated with the log element
* @param ourGraph the graph associated with the log element
*/
public OurLogElement(int step, String description, long value, visualizationElements.Graph ourGraph) {
this.step = step;
this.description = description;
this.value = value;
this.ourGraph = ourGraph;
}
2024-07-08 22:17:31 +00:00
/**
2024-07-08 22:17:31 +00:00
* Retrieves the sum up value associated with this log element.
*
* @return the sum up value of the log element
*/
2024-07-08 22:17:31 +00:00
public long getValue() {
2024-07-03 17:41:46 +00:00
return this.value;
}
2024-07-02 22:46:21 +00:00
2024-07-08 22:17:31 +00:00
/**
* Retrieves the edge associated with this log element.
*
* @return the edge associated with the log element
*/
2024-07-03 17:41:46 +00:00
public Edge getEdge() {
return this.edge;
2024-07-02 19:13:30 +00:00
}
2024-07-08 22:17:31 +00:00
/**
* Retrieves the vertex associated with this log element.
*
* @return the vertex associated with the log element
*/
2024-07-03 17:41:46 +00:00
public Vertex getVertex() {
return this.vertex;
}
2024-07-08 22:17:31 +00:00
/**
* Retrieves the graph associated with this log element.
*
* @return the graph associated with the log element
*/
public visualizationElements.Graph getGraph() {
return this.ourGraph;
}
}