Class IntegerList

  • All Implemented Interfaces:
    java.lang.Iterable<IntToken>, java.util.Collection<IntToken>, java.util.List<IntToken>

    public class IntegerList
    extends java.util.AbstractList<IntToken>
    A sparse list of integers.
    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
      IntegerList​(caltrop.interpreter.Context context, int a, int b)
      Construct a list of Integers IntegerList object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      IntToken get​(int n)
      Return an integer from the Caltrop interpreter context.
      int size()
      The size of the list.
      • 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

      • IntegerList

        public IntegerList​(caltrop.interpreter.Context context,
                           int a,
                           int b)
        Construct a list of Integers IntegerList object.
        Parameters:
        context - a Caltrop interpreter context.
        a - The lower limit of the range of integers.
        b - The upper limit of the range of integers.
    • Method Detail

      • get

        public IntToken get​(int n)
        Return an integer from the Caltrop interpreter context.
        Specified by:
        get in interface java.util.List<IntToken>
        Specified by:
        get in class java.util.AbstractList<IntToken>
        Parameters:
        n - The integer that is added to the a value and returned n+a must be less than or equal to b.
        Returns:
        the integer at slot a+n.
      • size

        public int size()
        The size of the list.
        Specified by:
        size in interface java.util.Collection<IntToken>
        Specified by:
        size in interface java.util.List<IntToken>
        Specified by:
        size in class java.util.AbstractCollection<IntToken>
        Returns:
        The size of the list. (b-a)+1