Package me.lemire.integercompression
Class IntWrapper
- java.lang.Object
-
- java.lang.Number
-
- me.lemire.integercompression.IntWrapper
-
- All Implemented Interfaces:
Serializable
public final class IntWrapper extends Number
Essentially a mutable wrapper around an integer.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IntWrapper()
Constructor: value set to 0.IntWrapper(int v)
Construction: value set to provided argument.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int v)
add the provided value to the integerdouble
doubleValue()
float
floatValue()
int
get()
void
increment()
add 1 to the integer valueint
intValue()
long
longValue()
void
set(int value)
Set the value to that of the specified integer.String
toString()
-
Methods inherited from class java.lang.Number
byteValue, shortValue
-
-
-
-
Method Detail
-
add
public void add(int v)
add the provided value to the integer- Parameters:
v
- value to add
-
doubleValue
public double doubleValue()
- Specified by:
doubleValue
in classNumber
-
floatValue
public float floatValue()
- Specified by:
floatValue
in classNumber
-
get
public int get()
- Returns:
- the integer value
-
increment
public void increment()
add 1 to the integer value
-
set
public void set(int value)
Set the value to that of the specified integer.- Parameters:
value
- specified integer value
-
-