Class Material
java.lang.Object
com.assemblyrobot.simulator.system.components.Material
- All Implemented Interfaces:
java.lang.Comparable<Material>
public class Material extends java.lang.Object implements java.lang.Comparable<Material>
Represents a product traveling through the production line in a simulated environment.
-
Constructor Summary
Constructors Constructor Description Material()
-
Method Summary
Modifier and Type Method Description int
compareTo(Material material)
long
getTotalPassthroughTime()
Calculates the amount of time theMaterial
spent in the system.void
reset()
Resets all class fields to their default values.static void
resetId()
void
setNextStage(@NonNull StageID nextStage)
Alternatively worded setter forcurrentStage
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Material
public Material()
-
-
Method Details
-
resetId
public static void resetId() -
reset
public void reset()Resets all class fields to their default values. Used when transferring betweenStage
s, since this object is not garbage collected until it has passed through the entire system. -
getTotalPassthroughTime
public long getTotalPassthroughTime()Calculates the amount of time theMaterial
spent in the system.- Returns:
- The difference of
processingEndTime
andprocessingStartTime
.
-
compareTo
- Specified by:
compareTo
in interfacejava.lang.Comparable<Material>
-