Class 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$
    Author:
    Jörn W. Janneck
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (cxh)
    • Field Summary

      • Fields inherited from class java.util.AbstractList

        modCount
    • Constructor Summary

      Constructors 
      Constructor Description
      PtArrayList​(ArrayToken arrayToken)
      Construct a PtArrayList from an ArrayToken.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
    • 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)
                  throws java.lang.ArrayIndexOutOfBoundsException
        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:
        java.lang.ArrayIndexOutOfBoundsException - 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.