Package de.monticore.tf.runtime
Class FastLookupList<T>
java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractList<T>
de.monticore.tf.runtime.FastLookupList<T>
- Type Parameters:
T- type of the list
- All Implemented Interfaces:
Iterable<T>,Collection<T>,List<T>,SequencedCollection<T>
A sliding range, read-only window of list.
Alternative to myList = new ArrayList(list);
myList.remove(0);
Calling
remove(int) of this class instead moves the read-window ahead.
Does not support updates to the underlying list.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected intFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionFastLookupList(List<T> list) FastLookupList(List<T> list, int removalCounter) -
Method Summary
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, set, subListMethods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArrayMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
addAll, addFirst, addLast, contains, containsAll, getFirst, getLast, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, sort, spliterator, toArray, toArray
-
Field Details
-
list
-
removalCounter
protected int removalCounter -
size
protected int size
-
-
Constructor Details
-
FastLookupList
-
FastLookupList
-
-
Method Details
-
reset
public void reset() -
get
-
remove
-
size
public int size()- Specified by:
sizein interfaceCollection<T>- Specified by:
sizein interfaceList<T>- Specified by:
sizein classAbstractCollection<T>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<T>- Specified by:
isEmptyin interfaceList<T>- Overrides:
isEmptyin classAbstractCollection<T>
-
matchCopy
-
toString
- Overrides:
toStringin classAbstractCollection<T>
-