Package org.apache.calcite.util
Class CastingList<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- org.apache.calcite.util.CastingList<E>
-
- Type Parameters:
E
- Element type
- All Implemented Interfaces:
java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.List<E>
public class CastingList<E> extends java.util.AbstractList<E> implements java.util.List<E>
Converts a list whose members are automatically down-cast to a given type.If a member of the backing list is not an instanceof
E
, the accessing method (such asList.get(int)
) will throw aClassCastException
.All modifications are automatically written to the backing list. Not synchronized.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CastingList(java.util.List<? super E> list, java.lang.Class<E> clazz)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int pos, E o)
E
get(int index)
E
remove(int index)
E
set(int index, E element)
int
size()
-
Methods inherited from class java.util.AbstractList
add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
-