|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | CONST | FIELD | CONSTR | METHOD | DETAIL: CONST | FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--satin.common.IntHolder
public final class IntHolder
extends java.lang.ObjectHolds 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
| 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 |
public int value
| Constructor Detail |
public IntHolder(int value)
| Method Detail |
public java.lang.String toString()
value.toString().
toString in class java.lang.Objectpublic boolean equals(java.lang.Object that)
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.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | CONST | FIELD | CONSTR | METHOD | DETAIL: CONST | FIELD | CONSTR | METHOD | ||||||||
IntHolder.java (PRIVATE SOURCES)