|
Project Wonder 5.0 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objecter.extensions.foundation.ERXMutableInteger
public class ERXMutableInteger
ERXMutableInteger is like Integer
but mutable, to avoid the excess object creation involved in
i = new Integer(i.getInt() + 1)
which can get expensive if done a lot.
Not subclassed from Integer, since Integer
is final (for performance.)
Original Author: Ian F. Darwin (Author of "Java Coolbook" ISBN: 0-596-00170-3)
| Constructor Summary | |
|---|---|
ERXMutableInteger(int value)
Constructs a newly allocated ERXMutableInteger object
that represents the primitive int argument. |
|
| Method Summary | |
|---|---|
void |
decrement()
Decrements the int value of this ERXMutalbleInteger object by 1. |
void |
decrement(int amount)
Decrements the int value of this ERXMutalbleInteger object by
the int argument. |
void |
increment()
Increments the int value of this ERXMutalbleInteger object by 1. |
void |
increment(int amount)
Increments the int value of this ERXMutalbleInteger object by
the int argument. |
int |
intValue()
Returns the int value represented by this ERXMutalbleInteger object. |
static int |
parseInt(java.lang.String str)
Parses the string argument as a signed decimal integer. |
void |
setIntValue(int value)
Updates the int value of this ERXMutalbleInteger object to
the int argument. |
java.lang.String |
toString()
Returns a string object representing this ERXMutalbeInteger's
value. |
static java.lang.String |
toString(int value)
Creates a string representation of the int argument. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ERXMutableInteger(int value)
ERXMutableInteger object
that represents the primitive int argument.
value - the int value to be represented by the
ERXMutalbleInteger object| Method Detail |
|---|
public void increment()
ERXMutalbleInteger object by 1.
public void increment(int amount)
ERXMutalbleInteger object by
the int argument.
amount - the int amount to incrementpublic void decrement()
ERXMutalbleInteger object by 1.
public void decrement(int amount)
ERXMutalbleInteger object by
the int argument.
amount - the int amount to decrementpublic void setIntValue(int value)
ERXMutalbleInteger object to
the int argument.
value - the int value to setpublic int intValue()
ERXMutalbleInteger object.
public java.lang.String toString()
ERXMutalbeInteger's
value. The value is converted to signed decimal representation and
returned as a string, exactly as if the integer value were given
as an argument to the toString(int) method.
toString in class java.lang.Objectpublic static java.lang.String toString(int value)
value - the int value to convert
public static int parseInt(java.lang.String str)
throws java.lang.NumberFormatException
Integer.parseInt method.
str - the string to parse
java.lang.NumberFormatException - if the String cannot be parsed as an int.
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||