Class AbstractProfileMonitor

    • Constructor Detail

      • AbstractProfileMonitor

        public AbstractProfileMonitor()
    • Method Detail

      • compareTo

        public final int compareTo​(ProfileMonitor other)
        The ProfileMonitor with the higher number of totals is considered as "greater".
        Specified by:
        compareTo in interface java.lang.Comparable<ProfileMonitor>
        Parameters:
        other - the other ProfileMonitor
        Returns:
        0 if both ProfileMonitors has the same result and the same label
      • getLastTime

        public final java.lang.String getLastTime()
        Gets the last value as time string. It returns the same result as ProfileMonitor.getLastValue() but in a human readable format. The english locale is used for formatting because this method is normally used for logging (which should be normally done in English).
        Specified by:
        getLastTime in interface ProfileMonitor
        Returns:
        the last time (e.g. "42 seconds")
        Since:
        1.4.2
      • equals

        public boolean equals​(java.lang.Object obj)
        If we impmlement the Comparable.compareTo(Object) method we should also implement/overwrite the Object.equals(Object) method. For the result of the equals method we use not the result of Comparable.compareTo(Object) but the label of the other object.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the other
        Returns:
        true, if successful
        See Also:
        Object.equals(java.lang.Object)
      • hashCode

        public int hashCode()
        Hash code.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the int
        See Also:
        Object.hashCode()