Package ptolemy.actor.gt.data
Class Pair<E1,E2>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.AbstractSequentialList<E>
-
- java.util.LinkedList<E>
-
- ptolemy.actor.gt.data.Tuple<java.lang.Object>
-
- ptolemy.actor.gt.data.Pair<E1,E2>
-
- Type Parameters:
E1
- Type of the first element.E2
- Type of the second element.
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<java.lang.Object>
,java.util.Collection<java.lang.Object>
,java.util.Deque<java.lang.Object>
,java.util.List<java.lang.Object>
,java.util.Queue<java.lang.Object>
- Direct Known Subclasses:
GraphAnalyzer.IndexedList
public class Pair<E1,E2> extends Tuple<java.lang.Object>
Generic pair data structure.- Since:
- Ptolemy II 8.0
- Version:
- $Id$
- Author:
- Thomas Huining Feng
- See Also:
- Serialized Form
- Pt.AcceptedRating:
- Red (tfeng)
- Pt.ProposedRating:
- Yellow (tfeng)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.-
Methods inherited from class java.util.LinkedList
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
-
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toString
-
-
-
-
Method Detail
-
getFirst
public E1 getFirst()
Get the first element.- Specified by:
getFirst
in interfacejava.util.Deque<E1>
- Overrides:
getFirst
in classjava.util.LinkedList<java.lang.Object>
- Returns:
- The first element.
- See Also:
setFirst(Object)
-
getSecond
public E2 getSecond()
Get the second element.- Returns:
- The second element.
- See Also:
setSecond(Object)
-
set
public void set(E1 first, E2 second)
Set the two elements in this pair.- Parameters:
first
- The first element.second
- The second element.
-
setFirst
public void setFirst(E1 first)
Set the first element in this pair.- Parameters:
first
- The first element.- See Also:
getFirst()
-
setSecond
public void setSecond(E2 second)
Set the second element in this pair.- Parameters:
second
- The first element.- See Also:
getSecond()
-
-