satin.common
Class IntHolder

java.lang.Object
  |
  +--satin.common.IntHolder

public final class IntHolder
extends java.lang.Object

Holds an int so it can be returned as an output parameter of a method. For example:

 // Returns the quotient, puts the remainder in 'remainder'.
 int divide (int dividend, int divisor, IntHolder remainder)
 {
     remainder.value = dividend % divisor;
     return dividend / divisor;
 }

 IntHolder rem = new IntHolder(0);
 int quo = divide(5, 3);
 // quo now holds 1, rem.value now holds 2

Author:
Ed Stauff

Field Summary
int value
          The value.
 
Constructor Summary
IntHolder(int value)
          The constructor.
 
Method Summary
boolean equals(java.lang.Object that)
          Convenient front-end; compares the values.
java.lang.String toString()
          Convenient front-end; equivalent to value.toString().
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

value

public int value
The value.
Constructor Detail

IntHolder

public IntHolder(int value)
The constructor.
Method Detail

toString

public java.lang.String toString()
Convenient front-end; equivalent to value.toString().

Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object that)
Convenient front-end; compares the values.

Overrides:
equals in class java.lang.Object
Revision History

5/31/01 Ed Stauff - initial code review.

3/26/01 Ed Stauff - added example of usage.

3/21/01 Ed Stauff - initial version reviewed by automation team.



Generated on 5/9/2001 19:37 from IntHolder.java (PRIVATE SOURCES)