jwutil.collections
Class Pair

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList
          extended by 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.
 
Method Summary
 void addEdge(java.lang.String edge, Textualizable t)
           
 java.lang.Object get(int index)
           
 java.lang.Object set(int index, java.lang.Object element)
           
 int size()
           
 void write(Textualizer t)
           
 void writeEdges(Textualizer t)
           
 
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
 

Field Detail

left

public java.lang.Object left
The elements of the pair.


right

public java.lang.Object right
The elements of the pair.

Constructor Detail

Pair

public Pair(java.lang.Object left,
            java.lang.Object right)
Construct a new Pair.

Parameters:
left - first element
right - second element
Method Detail

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.