Package org.zkoss.lang
Class MutableInteger
java.lang.Object
org.zkoss.lang.MutableInteger
- All Implemented Interfaces:
Comparable<MutableInteger>
Represents an integer that can be modified.
It is useful if you want to pass an integer to a method and like to keep the result of how the method modifies the value.
- Author:
- tomyeh
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCompares twoMutableIntegerobjects numerically.booleaninthashCode()intintValue()Returns the value of thisMutableIntegeras an int.voidsetValue(int value) Sets the value of thisMutableInteger.toString()
-
Field Details
-
value
public int valueThe value of the mutable integer.
-
-
Constructor Details
-
MutableInteger
public MutableInteger(int value)
-
-
Method Details
-
intValue
public int intValue()Returns the value of thisMutableIntegeras an int. -
setValue
public void setValue(int value) Sets the value of thisMutableInteger. -
compareTo
Compares twoMutableIntegerobjects numerically.- Specified by:
compareToin interfaceComparable<MutableInteger>- Returns:
- the value 0 if the argument is numerically equal to this; a value less than 0 if the argument is numerically greater than this; and a value greater than 0 if the argument is numerically less than this.
-
toString
-
hashCode
public int hashCode() -
equals
-