Class IndexList

  • All Implemented Interfaces:
    Serializable, Cloneable, Iterable, Collection, List, RandomAccess

    public class IndexList
    extends ArrayList
    A simple list of indices for a stem. This refers to a single value. so if this is [1,2,3,4] then this is interpreted when accessing the stem as

    a.1.2.3.4 == a.[1,2,3,4]

    It is assumed that all values have been resolved, so these are just constants, though they may be used to resolve other values. E.g.
         a.2.b.[1,2] == a.2.(b.1.2)
     
    So the index is used to resolve b.

    Created by Jeff Gaynor
    on 6/12/21 at 6:47 AM

    See Also:
    Serialized Form
    • Constructor Detail

      • IndexList

        public IndexList​(int initialCapacity)
        Unlike standard ArrayList, this fills up the list with nulls. This is because it allows the individual elements to be managed later
        Parameters:
        initialCapacity -
      • IndexList

        public IndexList()
      • IndexList

        public IndexList​(QDLStem stemVariable)
    • Method Detail

      • tail

        public IndexList tail​(int n)
        return the last n elements of this index list
        Parameters:
        n -
        Returns:
      • truncate

        public void truncate​(int n)
        Drops everything from index n on. New index list has n elements
        Parameters:
        n -
      • clone

        public List<IndexList> clone​(int n)
        Return n clones of this object, so if this object has m elements, this returns n*m elements.
        Parameters:
        n -
        Returns: