Class MutableInteger

java.lang.Object
org.zkoss.lang.MutableInteger
All Implemented Interfaces:
Comparable<MutableInteger>

public class MutableInteger extends Object implements 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 Details

    • value

      public int value
      The value of the mutable integer.
  • Constructor Details

    • MutableInteger

      public MutableInteger(int value)
  • Method Details

    • 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.
      Specified by:
      compareTo in interface 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 String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object