|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpeak.can.MutableInteger
public class MutableInteger
The MutableInteger class wraps a value of the primitive type int in an object. An object of type Integer contains a single field whose type is int. This class is used because Java.Lang.Integer objects are defined as Imutable. Yet, we need to maintain object reference when it's passed to the JNI library using. So, we defined a simple Class which extends Java.Lang.Object to resolve the problematic.
Field Summary | |
---|---|
int |
value
|
Constructor Summary | |
---|---|
MutableInteger(int value)
Constructor |
|
MutableInteger(java.lang.String value)
Constructor parsing the string argument as a integer |
Method Summary | |
---|---|
int |
getValue()
Gets integer value |
void |
setValue(int value)
Sets integer value |
java.lang.String |
toString()
Overrides toString() to display int value |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int value
Constructor Detail |
---|
public MutableInteger(int value)
value
- int valuepublic MutableInteger(java.lang.String value)
value
- integer as stringMethod Detail |
---|
public int getValue()
public void setValue(int value)
integer
- valuepublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |