E1
- Type of the first element.E2
- Type of the second element.public class Pair<E1,E2> extends Tuple<java.lang.Object>
Red (tfeng) |
Yellow (tfeng) |
Constructor and Description |
---|
Pair(E1 first,
E2 second)
Construct a pair with two elements.
|
Modifier and Type | Method and Description |
---|---|
E1 |
getFirst()
Get the first element.
|
E2 |
getSecond()
Get the second element.
|
void |
set(E1 first,
E2 second)
Set the two elements in this pair.
|
void |
setFirst(E1 first)
Set the first element in this pair.
|
void |
setSecond(E2 second)
Set the second element in this pair.
|
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArray
equals, hashCode, listIterator, removeRange, subList
containsAll, isEmpty, removeAll, retainAll, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
public E1 getFirst()
getFirst
in interface java.util.Deque<java.lang.Object>
getFirst
in class java.util.LinkedList<java.lang.Object>
setFirst(Object)
public E2 getSecond()
setSecond(Object)
public void set(E1 first, E2 second)
first
- The first element.second
- The second element.public void setFirst(E1 first)
first
- The first element.getFirst()
public void setSecond(E2 second)
second
- The first element.getSecond()