Package com.globalmentor.java
Class AbstractLong<L extends java.lang.Number>
- java.lang.Object
-
- java.lang.Number
-
- com.globalmentor.java.AbstractLong<L>
-
- 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 toNumber.longValue()
.boolean
equals(java.lang.Object object)
This compares the value ofNumber.longValue()
if the given object is an instance of the concrete subclass of this class.float
floatValue()
This version delegates todoubleValue()
.int
hashCode()
This returns a hash code ofNumber.longValue()
.int
intValue()
This version delegates toNumber.longValue()
.
-
-
-
Method Detail
-
intValue
public int intValue()
This version delegates toNumber.longValue()
.- Specified by:
intValue
in classjava.lang.Number
-
floatValue
public float floatValue()
This version delegates todoubleValue()
.- Specified by:
floatValue
in classjava.lang.Number
-
doubleValue
public double doubleValue()
This version delegates toNumber.longValue()
.- Specified by:
doubleValue
in classjava.lang.Number
-
hashCode
public int hashCode()
This returns a hash code ofNumber.longValue()
.- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object object)
This compares the value ofNumber.longValue()
if the given object is an instance of the concrete subclass of this class.- Overrides:
equals
in classjava.lang.Object
-
-