Class HistogramType

  • All Implemented Interfaces:
    java.io.Serializable

    public class HistogramType
    extends java.lang.Object
    implements java.io.Serializable
    A class for creating constants to represent the histogram type. See Bloch's enum tip in 'Effective Java'.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private HistogramType​(java.lang.String name)
      Creates a new type.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      Tests this type for equality with an arbitrary object.
      int hashCode()
      Returns a hash code value for the object.
      private java.lang.Object readResolve()
      Ensures that serialization returns the unique instances.
      java.lang.String toString()
      Returns a string representing the object.
      • Methods inherited from class java.lang.Object

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

      • serialVersionUID

        private static final long serialVersionUID
        For serialization.
        See Also:
        Constant Field Values
      • FREQUENCY

        public static final HistogramType FREQUENCY
        Frequency histogram.
      • RELATIVE_FREQUENCY

        public static final HistogramType RELATIVE_FREQUENCY
        Relative frequency.
      • SCALE_AREA_TO_1

        public static final HistogramType SCALE_AREA_TO_1
        Scale area to one.
      • name

        private java.lang.String name
        The type name.
    • Constructor Detail

      • HistogramType

        private HistogramType​(java.lang.String name)
        Creates a new type.
        Parameters:
        name - the name.
    • Method Detail

      • toString

        public java.lang.String toString()
        Returns a string representing the object.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The string.
      • equals

        public boolean equals​(java.lang.Object obj)
        Tests this type for equality with an arbitrary object.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the object to test against.
        Returns:
        A boolean.
      • hashCode

        public int hashCode()
        Returns a hash code value for the object.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        The hashcode
      • readResolve

        private java.lang.Object readResolve()
                                      throws java.io.ObjectStreamException
        Ensures that serialization returns the unique instances.
        Returns:
        The object.
        Throws:
        java.io.ObjectStreamException - if there is a problem.