ptolemy.actor.gt.data
Class Pair<E1,E2>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.AbstractSequentialList<E>
              extended by java.util.LinkedList<E>
                  extended by ptolemy.actor.gt.data.Tuple<java.lang.Object>
                      extended by 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.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: Pair.java 54815 2009-06-30 05:18:27Z tfeng $
Author:
Thomas Huining Feng
See Also:
Serialized Form
Accepted Rating:
Red (tfeng)
Proposed Rating:
Yellow (tfeng)

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Pair(E1 first, E2 second)
          Construct a pair with two elements.
 
Method Summary
 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, element, get, getLast, indexOf, lastIndexOf, listIterator, offer, peek, poll, remove, remove, remove, removeFirst, removeLast, set, size, toArray, toArray
 
Methods inherited from class java.util.AbstractSequentialList
iterator
 
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

Pair

public Pair(E1 first,
            E2 second)
Construct a pair with two elements.

Parameters:
first - The first element.
second - The second element.
Method Detail

getFirst

public E1 getFirst()
Get the first element.

Overrides:
getFirst in class java.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()