Package org.qdl_lang.expressions
Class IndexList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList
-
- org.qdl_lang.expressions.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
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IndexList
clone()
List<IndexList>
clone(int n)
Return n clones of this object, so if this object has m elements, this returns n*m elements.IndexList
tail(int n)
return the last n elements of this index listvoid
truncate(int n)
Drops everything from index n on.-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from class java.util.AbstractCollection
containsAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Methods inherited from interface java.util.List
containsAll
-
-
-
-
Constructor Detail
-
IndexList
public IndexList(int initialCapacity)
Unlike standardArrayList
, 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
-
-
-