Package com.helger.commons.mutable
Interface INumber
-
- All Known Subinterfaces:
IMutableInteger<IMPLTYPE>,IMutableNumeric<IMPLTYPE>
- All Known Implementing Classes:
AbstractMutableInteger,AbstractMutableNumeric,MutableBigDecimal,MutableBigInteger,MutableByte,MutableChar,MutableDouble,MutableFloat,MutableInt,MutableLong,MutableShort
public interface INumberBase interface comparable toNumber- but an interface and not an abstract class.- Author:
- Philip Helger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default bytebyteValue()Returns the value of the specified number as abyte, which may involve rounding or truncation.doubledoubleValue()Returns the value of the specified number as adouble, which may involve rounding.floatfloatValue()Returns the value of the specified number as afloat, which may involve rounding.intintValue()Returns the value of the specified number as anint, which may involve rounding or truncation.longlongValue()Returns the value of the specified number as along, which may involve rounding or truncation.default shortshortValue()Returns the value of the specified number as ashort, which may involve rounding or truncation.
-
-
-
Method Detail
-
intValue
int intValue()
Returns the value of the specified number as anint, which may involve rounding or truncation.- Returns:
- the numeric value represented by this object after conversion to
type
int.
-
longValue
long longValue()
Returns the value of the specified number as along, which may involve rounding or truncation.- Returns:
- the numeric value represented by this object after conversion to
type
long.
-
floatValue
float floatValue()
Returns the value of the specified number as afloat, which may involve rounding.- Returns:
- the numeric value represented by this object after conversion to
type
float.
-
doubleValue
double doubleValue()
Returns the value of the specified number as adouble, which may involve rounding.- Returns:
- the numeric value represented by this object after conversion to
type
double.
-
byteValue
default byte byteValue()
Returns the value of the specified number as abyte, which may involve rounding or truncation.This implementation returns the result of
intValue()cast to abyte.- Returns:
- the numeric value represented by this object after conversion to
type
byte.
-
shortValue
default short shortValue()
Returns the value of the specified number as ashort, which may involve rounding or truncation.This implementation returns the result of
intValue()cast to ashort.- Returns:
- the numeric value represented by this object after conversion to
type
short.
-
-