org.zkoss.lang
Class MutableInteger

java.lang.Object
  extended by org.zkoss.lang.MutableInteger
All Implemented Interfaces:
java.lang.Comparable

public class MutableInteger
extends java.lang.Object
implements java.lang.Comparable

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
 int value
          The value of the mutable integer.
 
Constructor Summary
MutableInteger(int value)
           
 
Method Summary
 int compareTo(MutableInteger o)
          Compares two MutableInteger objects numerically.
 int compareTo(java.lang.Object o)
          Compares two MutableInteger objects numerically.
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 int intValue()
          Returns the value of this MutableInteger as an int.
 void setValue(int value)
          Sets the value of this MutableInteger.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

value

public int value
The value of the mutable integer.

Constructor Detail

MutableInteger

public MutableInteger(int value)
Method Detail

intValue

public int intValue()
Returns the value of this MutableInteger as an int.


setValue

public void setValue(int value)
Sets the value of this MutableInteger.


compareTo

public int compareTo(MutableInteger o)
Compares two MutableInteger objects numerically.

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.

compareTo

public int compareTo(java.lang.Object o)
Compares two MutableInteger objects numerically.

Specified by:
compareTo in interface java.lang.Comparable
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 class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo