me.lemire.integercompression
Class IntWrapper

java.lang.Object
  extended by java.lang.Number
      extended by me.lemire.integercompression.IntWrapper
All Implemented Interfaces:
Serializable

public final class IntWrapper
extends Number

Essentially a mutable wrapper around an integer.

Author:
dwu
See Also:
Serialized Form

Constructor Summary
IntWrapper()
          Constructor: value set to 0.
IntWrapper(int v)
          Construction: value set to provided argument.
 
Method Summary
 void add(int v)
           
 double doubleValue()
           
 float floatValue()
           
 int get()
           
 void increment()
          add 1 to the integer value
 int 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IntWrapper

public IntWrapper()
Constructor: value set to 0.


IntWrapper

public IntWrapper(int v)
Construction: value set to provided argument.

Parameters:
v - value to wrap
Method Detail

add

public void add(int v)
Parameters:
v -

doubleValue

public double doubleValue()
Specified by:
doubleValue in class Number

floatValue

public float floatValue()
Specified by:
floatValue in class Number

get

public int get()
Returns:
the integer value

increment

public void increment()
add 1 to the integer value


intValue

public int intValue()
Specified by:
intValue in class Number

longValue

public long longValue()
Specified by:
longValue in class Number

set

public void set(int value)
Set the value to that of the specified integer.

Parameters:
value - specified integer value

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.