Class AbstractLong<L extends java.lang.Number>

  • Type Parameters:
    L - The type of long represented.
    All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<L>
    Direct Known Subclasses:
    Count

    public abstract class AbstractLong<L extends java.lang.Number>
    extends java.lang.Number
    implements java.lang.Comparable<L>
    Abstract base class for number that represent long values.

    This class provides an equals(Object) implementation that requires the compared object be an instance of the concrete subclass of this class.

    Author:
    Garret Wilson
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractLong()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(L l)  
      double doubleValue()
      This version delegates to Number.longValue().
      boolean equals​(java.lang.Object object)
      This compares the value of Number.longValue() if the given object is an instance of the concrete subclass of this class.
      float floatValue()
      This version delegates to doubleValue().
      int hashCode()
      This returns a hash code of Number.longValue().
      int intValue()
      This version delegates to Number.longValue().
      • Methods inherited from class java.lang.Number

        byteValue, longValue, shortValue
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractLong

        public AbstractLong()
    • Method Detail

      • intValue

        public int intValue()
        This version delegates to Number.longValue().
        Specified by:
        intValue in class java.lang.Number
      • floatValue

        public float floatValue()
        This version delegates to doubleValue().
        Specified by:
        floatValue in class java.lang.Number
      • doubleValue

        public double doubleValue()
        This version delegates to Number.longValue().
        Specified by:
        doubleValue in class java.lang.Number
      • hashCode

        public int hashCode()
        This returns a hash code of Number.longValue().
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object object)
        This compares the value of Number.longValue() if the given object is an instance of the concrete subclass of this class.
        Overrides:
        equals in class java.lang.Object
      • compareTo

        public int compareTo​(L l)
        Specified by:
        compareTo in interface java.lang.Comparable<L extends java.lang.Number>