Package org.graphstream.util
Class StepCounter
java.lang.Object
org.graphstream.stream.SinkAdapter
org.graphstream.util.StepCounter
- All Implemented Interfaces:
AttributeSink,ElementSink,Sink
public class StepCounter extends SinkAdapter
Count the step of a stream.
-
Constructor Summary
Constructors Constructor Description StepCounter()Default constructor. -
Method Summary
Modifier and Type Method Description static intcountStepInFile(String path)Count step contains in a file.intgetStepCount()Get the step count.voidreset()Reset the step count to zero.voidstepBegins(String sourceId, long timeId, double time)Since dynamic graphs are based on discrete event modifications, the notion of step is defined to simulate elapsed time between events.Methods inherited from class org.graphstream.stream.SinkAdapter
edgeAdded, edgeAttributeAdded, edgeAttributeChanged, edgeAttributeRemoved, edgeRemoved, graphAttributeAdded, graphAttributeChanged, graphAttributeRemoved, graphCleared, nodeAdded, nodeAttributeAdded, nodeAttributeChanged, nodeAttributeRemoved, nodeRemoved
-
Constructor Details
-
StepCounter
public StepCounter()Default constructor. Count is set to zero.
-
-
Method Details
-
countStepInFile
Count step contains in a file.- Parameters:
path- path to the file- Returns:
- count of step event in the file
- Throws:
IOException- See Also:
FileSourceFactory
-
reset
public void reset()Reset the step count to zero. -
getStepCount
public int getStepCount()Get the step count.- Returns:
- the count of step
-
stepBegins
Description copied from interface:ElementSinkSince dynamic graphs are based on discrete event modifications, the notion of step is defined to simulate elapsed time between events. So a step is a event that occurs in the graph, it does not modify it but it gives a kind of timestamp that allow the tracking of the progress of the graph over the time.
This kind of event is useful for dynamic algorithms that listen to the dynamic graph and need to measure the time in the graph's evolution.
- Specified by:
stepBeginsin interfaceElementSink- Overrides:
stepBeginsin classSinkAdapter- Parameters:
sourceId- Identifier of the graph where the step starts.timeId- A numerical value that may give a timestamp to track the evolution of the graph over the time.
-