Package org.zkoss.lang
Class MutableInteger
- java.lang.Object
-
- org.zkoss.lang.MutableInteger
-
- All Implemented Interfaces:
java.lang.Comparable<MutableInteger>
public class MutableInteger extends java.lang.Object implements java.lang.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 Modifier and Type Field Description int
value
The value of the mutable integer.
-
Constructor Summary
Constructors Constructor Description MutableInteger(int value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(MutableInteger o)
Compares twoMutableInteger
objects numerically.boolean
equals(java.lang.Object o)
int
hashCode()
int
intValue()
Returns the value of thisMutableInteger
as an int.void
setValue(int value)
Sets the value of thisMutableInteger
.java.lang.String
toString()
-
-
-
Method Detail
-
intValue
public int intValue()
Returns the value of thisMutableInteger
as an int.
-
setValue
public void setValue(int value)
Sets the value of thisMutableInteger
.
-
compareTo
public int compareTo(MutableInteger o)
Compares twoMutableInteger
objects numerically.- Specified by:
compareTo
in interfacejava.lang.Comparable<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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
-