|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcds.util.PairInteger
Manages a pair of integers. Very simple class, sometimes usefull when a method has to return two numbers (like beginning and end of a substring.
| Field Summary | |
private int |
a
|
private int |
b
|
| Constructor Summary | |
PairInteger(int a,
int b)
Constructor. |
|
PairInteger(PairInteger p)
Copy constructor. |
|
| Method Summary | |
int |
distance()
Computes the distance between first and second integer (second - first) |
boolean |
equals(java.lang.Object o)
MOD-BB 21-01-04 Ajout de cette methode. |
int |
getFirst()
Get the first integer |
int |
getSecond()
Get the first integer |
void |
setFirst(int a)
Sets the first integer. |
void |
setSecond(int b)
Sets the second integer. |
void |
setValues(int a,
int b)
Sets the values to a pairInteger object |
void |
setValues(PairInteger p)
Sets the values to a pairInteger object |
java.lang.String |
toString()
Get the pair in a string as 'a,b' |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private int a
private int b
| Constructor Detail |
public PairInteger(int a,
int b)
a - first integerb - second integerpublic PairInteger(PairInteger p)
p - PairInteger object| Method Detail |
public final void setFirst(int a)
a - first integer.public final void setSecond(int b)
b - second integer
public final void setValues(int a,
int b)
a - first integerb - second integerpublic final void setValues(PairInteger p)
p - PairInteger objectpublic final int getFirst()
public final int getSecond()
public java.lang.String toString()
public int distance()
public boolean equals(java.lang.Object o)
o - Objet a comparer.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||