|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectco.cask.common.ImmutablePair<A,B>
A - type AB - type Bpublic final class ImmutablePair<A,B>
An ImmutablePair consists of two elements within. The elements once set
in the ImmutablePair cannot be modified. The class itself is final, so that it
cannot be subclassed. This is general norm for creating Immutable classes.
Please note that the ImmutablePair cannot be modified once set, but the
objects within them can be, so in general it means that if there are mutable objects
within the pair then the pair itself is effectively mutable.
ImmutablePairtupleStreamPair= new ImmutablePair (tuple, identifier); ... ... Tuple t = tupleStreamPair.getFirst(); TupleInputStreamIdentifier identifier = tupleStreamPair.getSecond(); ...
| Constructor Summary | |
|---|---|
ImmutablePair(A first,
B second)
Constructs a Immutable Pair. |
|
| Method Summary | ||
|---|---|---|
boolean |
equals(Object o)
Returns whether some other object "is equal" to this object. |
|
A |
getFirst()
Returns first object from pair. |
|
B |
getSecond()
Return second object from pair. |
|
int |
hashCode()
Returns a hash code value for this object. |
|
static
|
of(A first,
B second)
|
|
String |
toString()
Returns a string representation of ImmutablePair object. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ImmutablePair(A first,
B second)
first - object in pairsecond - object in pair| Method Detail |
|---|
public static <A,B> ImmutablePair<A,B> of(A first,
B second)
public A getFirst()
public B getSecond()
public String toString()
ImmutablePair object.
toString in class Objectpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object o)
equals in class Objecto - reference object with which to compare
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||