ptolemy.caltrop.util
Class PtArrayList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<Token>
          extended by ptolemy.caltrop.util.PtArrayList
All Implemented Interfaces:
java.lang.Iterable<Token>, java.util.Collection<Token>, java.util.List<Token>

public class PtArrayList
extends java.util.AbstractList<Token>

A List representation of an ArrayToken.

Since:
Ptolemy II 4.0
Version:
$Id: PtArrayList.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Jörn W. Janneck
Accepted Rating:
Red (cxh)
Proposed Rating:
Red (cxh)

Field Summary
private  ArrayToken _arrayToken
           
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
PtArrayList(ArrayToken arrayToken)
          Construct a PtArrayList from an ArrayToken.
 
Method Summary
 Token get(int index)
          Get the token at the given index.
 int size()
          Return the size of the array.
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, 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

_arrayToken

private ArrayToken _arrayToken
Constructor Detail

PtArrayList

public PtArrayList(ArrayToken arrayToken)
Construct a PtArrayList from an ArrayToken.

Parameters:
arrayToken - The arrayToken with which to construct the List.
Method Detail

get

public Token get(int index)
Get the token at the given index. The type of the return

Specified by:
get in interface java.util.List<Token>
Specified by:
get in class java.util.AbstractList<Token>
Parameters:
index - The index of the desired element.
Returns:
The token contained in this array token at the specified index.
Throws:
ArrayIndexOutOfBoundException - If the specified index is outside the range of the token array.

size

public int size()
Return the size of the array.

Specified by:
size in interface java.util.Collection<Token>
Specified by:
size in interface java.util.List<Token>
Specified by:
size in class java.util.AbstractCollection<Token>
Returns:
size The length of the ArrayToken.