jwutil.collections
Class Pair
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList
jwutil.collections.Pair
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Iterable, java.util.Collection, java.util.List, Textualizable
public class Pair
- extends java.util.AbstractList
- implements java.io.Serializable, Textualizable
List of two elements.
- Version:
- $Id: Pair.java 2249 2005-04-29 02:32:27Z joewhaley $
- Author:
- John Whaley
- See Also:
- Serialized Form
Field Summary |
java.lang.Object |
left
The elements of the pair. |
java.lang.Object |
right
The elements of the pair. |
Fields inherited from class java.util.AbstractList |
modCount |
Constructor Summary |
Pair(java.lang.Object left,
java.lang.Object right)
Construct a new Pair. |
Methods inherited from class java.util.AbstractList |
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, subList |
Methods inherited from class java.util.AbstractCollection |
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
left
public java.lang.Object left
- The elements of the pair.
right
public java.lang.Object right
- The elements of the pair.
Pair
public Pair(java.lang.Object left,
java.lang.Object right)
- Construct a new Pair.
- Parameters:
left
- first elementright
- second element
size
public int size()
- Specified by:
size
in interface java.util.Collection
- Specified by:
size
in interface java.util.List
- Specified by:
size
in class java.util.AbstractCollection
get
public java.lang.Object get(int index)
- Specified by:
get
in interface java.util.List
- Specified by:
get
in class java.util.AbstractList
set
public java.lang.Object set(int index,
java.lang.Object element)
- Specified by:
set
in interface java.util.List
- Overrides:
set
in class java.util.AbstractList
write
public void write(Textualizer t)
throws java.io.IOException
- Specified by:
write
in interface Textualizable
- Throws:
java.io.IOException
writeEdges
public void writeEdges(Textualizer t)
throws java.io.IOException
- Specified by:
writeEdges
in interface Textualizable
- Throws:
java.io.IOException
addEdge
public void addEdge(java.lang.String edge,
Textualizable t)
- Specified by:
addEdge
in interface Textualizable
Copyright © 2004-2008 SUIF Compiler Group. All Rights Reserved.