public class MutableInteger extends Object
| Constructor and Description |
|---|
MutableInteger()
Creates a new instance with value equal to 0.
|
MutableInteger(int value)
Creates a new instance with value equal to what is given.
|
| Modifier and Type | Method and Description |
|---|---|
String |
gensym(String prefix)
Creates a string by incrementing the value and returning the concatenation
of the prefix and the old value.
|
int |
getValue()
Returns the current value.
|
int |
incValue()
Increases the value by 1 and returns the old value.
|
void |
max(int value)
Returns the maximum of the current value and the one given.
|
void |
setValue(int value)
Changes the value to one given.
|
String |
toString() |
public MutableInteger()
public MutableInteger(int value)
value - public int getValue()
public void setValue(int value)
value - public int incValue()
public void max(int value)
value - Copyright © 2017. All rights reserved.