|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ckkloverdos.tuple.TupleSkeleton
org.ckkloverdos.tuple.Pair
public class Pair
Implements IPair.
| Field Summary | |
|---|---|
protected java.lang.Object |
a
|
protected java.lang.Object |
b
|
| Constructor Summary | |
|---|---|
Pair(java.lang.Object a,
java.lang.Object b)
Contsructs the pair from the two objects. |
|
| Method Summary | |
|---|---|
java.lang.Object |
get(int n)
Returns the nth element of the tuple. |
java.lang.Object |
getA()
Returns the first element. |
java.lang.Object |
getB()
Returns the second element. |
boolean |
isEmpty()
Always returns false, since a pair contains exactly two
elements, even if they are null. |
boolean |
isNull(int n)
Returns true iff the nth element
of the tuple is null. |
int |
size()
Returns the size of the pair, which is always two. |
| Methods inherited from class org.ckkloverdos.tuple.TupleSkeleton |
|---|
equals, hashCode |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.Object a
protected java.lang.Object b
| Constructor Detail |
|---|
public Pair(java.lang.Object a,
java.lang.Object b)
a - b - | Method Detail |
|---|
public java.lang.Object getA()
get(0).
getA in interface IPairpublic java.lang.Object getB()
get(1).
getB in interface IPairpublic java.lang.Object get(int n)
nth element of the tuple.
The first element is at index zero, the second element
is at index one.
get in interface ITuplen -
java.lang.IndexOutOfBoundsException - if the index n
is other than zero or one.public int size()
size in interface ITuplepublic boolean isNull(int n)
true iff the nth element
of the tuple is null.
The first element is at index zero, the second element
is at index one.
isNull in interface ITuplen -
java.lang.IndexOutOfBoundsException - if the index n
is other than zero or one.public boolean isEmpty()
false, since a pair contains exactly two
elements, even if they are null.
isEmpty in interface ITuple
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||