Class MemoryTracer

java.lang.Object
overit.geocall.util.tracer.MemoryTracer
All Implemented Interfaces:
Serializable, Tracer
Direct Known Subclasses:
PlainTracer, StartEndTracer

public abstract class MemoryTracer extends Object implements Tracer, Serializable
Abstract class to extend to create a tracer. When you extends the class the method to be implemented is getRegistry(). The static method that chooses which instance of tracer to create is makeTracer().
See Also:
  • Field Details

    • _maxSize

      protected int _maxSize
    • _time

      protected long _time
      If it is less than 0, the data of start is recorded, otherwise the delta.
  • Constructor Details

    • MemoryTracer

      public MemoryTracer()
  • Method Details

    • makeTracer

      public static MemoryTracer makeTracer(String type, int maxSize)
      The static method that chooses which instance of tracer must be created.
      The default instantiated tracer is StartEndTracer but if the second parameter is set with the string "plain" (it is not case sensitive), the instantiated tracer will be PlainTracer.
      Parameters:
      type - Type of tracer. If it is null the instantiated tracer will be StartEndTracer; if it is "plain", the tracer will be PlainTracer.
      maxSize - Number maximum of the rows to print.
      Returns:
      The instance of the tracer.
    • getRegistry

      public abstract ArrayList getRegistry()
      Method to implement in the classes that extend the MemoryTracer. This must return the ArrayList with all the records of the log.
      Returns:
      The ArrayList contains all the records of the log.