Class NailStats

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class NailStats
    extends java.lang.Object
    implements java.lang.Cloneable

    Collects and provides statistics on a nail.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Object lock  
      private java.lang.Class nailclass  
      private long refCounter  
      private long runCounter  
    • Constructor Summary

      Constructors 
      Constructor Description
      NailStats​(java.lang.Class nailclass)
      Creates a new NailStats object for the specified class
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()
      Creates a copy of this NailStats object.
      boolean equals​(java.lang.Object o)
      Returns true iff the specified NailStats object is tracking the same class.
      java.lang.Class getNailClass()
      Returns the class for which we're tracking statistics
      long getRefCount()
      Returns the number of sessions currently running this nail.
      long getRunCount()
      Returns the number of times this nail has been run.
      int hashCode()  
      (package private) void nailFinished()
      Logs the fact that an instance of this nail has finished
      (package private) void nailStarted()
      Logs the fact that an instance of this nail has started
      java.lang.String toString()
      Returns a String representation of this NailStats object, in the form "classname: runcount/refcount".
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • nailclass

        private final java.lang.Class nailclass
      • runCounter

        private long runCounter
      • refCounter

        private long refCounter
      • lock

        private final java.lang.Object lock
    • Constructor Detail

      • NailStats

        NailStats​(java.lang.Class nailclass)
        Creates a new NailStats object for the specified class
        Parameters:
        nailclass - the class for which we'll collect statistics
    • Method Detail

      • nailStarted

        void nailStarted()
        Logs the fact that an instance of this nail has started
      • nailFinished

        void nailFinished()
        Logs the fact that an instance of this nail has finished
      • getRunCount

        public long getRunCount()
        Returns the number of times this nail has been run. Nails that have started but not yet finished are included in this number.
        Returns:
        the number of times this nail has been run.
      • getRefCount

        public long getRefCount()
        Returns the number of sessions currently running this nail.
        Returns:
        the number of sessions currently running this nail.
      • getNailClass

        public java.lang.Class getNailClass()
        Returns the class for which we're tracking statistics
        Returns:
        the class for which we're tracking statistics
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
        See Also:
        Object.hashCode()
      • equals

        public boolean equals​(java.lang.Object o)
        Returns true iff the specified NailStats object is tracking the same class.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - the NailStats object to check
        Returns:
        true iff the specified NailStats object is tracking the same class.
      • clone

        public java.lang.Object clone()
        Creates a copy of this NailStats object.
        Overrides:
        clone in class java.lang.Object
        Returns:
        a copy of this NailStats object.
      • toString

        public java.lang.String toString()
        Returns a String representation of this NailStats object, in the form "classname: runcount/refcount". *return a String representation of this NailStats object.
        Overrides:
        toString in class java.lang.Object