Package org.alfresco.solr
Class ResizeableArrayList<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- org.alfresco.solr.ResizeableArrayList<E>
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<E>,java.util.Collection<E>,java.util.List<E>,java.util.RandomAccess
public class ResizeableArrayList<E> extends java.util.AbstractList<E> implements java.util.List<E>, java.util.RandomAccess, java.lang.Cloneable, java.io.SerializableAListimplementation, backed by an array, taht supports resizing. This class supports the reuse of arrays across cache instances, reducing the number of temporary objects created by the Alfresco Solr indexing service.- Author:
- Alex Miller
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ResizeableArrayList()ResizeableArrayList(int initialSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Objectclone()<T> voidcopyFrom(ResizeableArrayList<T> from)Copy elements from from into this instanceEget(int index)voidresize(int minSize)Resize the underlying to at least minSize.Eset(int index, E value)intsize()voidsort(java.util.Comparator<? super E> comparator)Sort the elements, in-place, contained in this list using {@link Comparator#}-
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
-
-
-
Method Detail
-
get
public E get(int index)
-
resize
public void resize(int minSize)
Resize the underlying to at least minSize.- Parameters:
minSize-- Throws:
java.lang.IllegalStateException- if the instance is not active.
-
size
public int size()
-
copyFrom
public <T> void copyFrom(ResizeableArrayList<T> from)
Copy elements from from into this instance
-
clone
protected java.lang.Object clone() throws java.lang.CloneNotSupportedException- Overrides:
clonein classjava.lang.Object- Throws:
java.lang.CloneNotSupportedException
-
-