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 the Material 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 for currentStage.

    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 between Stages, since this object is not garbage collected until it has passed through the entire system.
    • setNextStage

      public void setNextStage​(@NonNull @NonNull StageID nextStage)
      Alternatively worded setter for currentStage. Used for setting the "new" current stage in a more declarative way.
      Parameters:
      nextStage - The next Stage this material is headed to.
    • getTotalPassthroughTime

      public long getTotalPassthroughTime()
      Calculates the amount of time the Material spent in the system.
      Returns:
      The difference of processingEndTime and processingStartTime.
    • compareTo

      public int compareTo​(Material material)
      Specified by:
      compareTo in interface java.lang.Comparable<Material>