com.threerings.opengl.model.tools
Class ModelDef.HashArrayList<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<E>
com.threerings.opengl.model.tools.ModelDef.HashArrayList<E>
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<E>, Collection<E>, List<E>, RandomAccess
- Enclosing class:
- ModelDef
protected static class ModelDef.HashArrayList<E>
- extends ArrayList<E>
Accelerates ArrayList.indexOf(java.lang.Object), ArrayList.contains(java.lang.Object), and
ArrayList.remove(int) using an internal hash map (assumes that all elements of the list
are unique and non-null).
- See Also:
- Serialized Form
| Methods inherited from class java.util.ArrayList |
addAll, addAll, clone, ensureCapacity, get, isEmpty, lastIndexOf, removeRange, set, size, toArray, toArray, trimToSize |
_indices
protected HashMap<Object,Integer> _indices
- Maps elements to their indices in the list.
ModelDef.HashArrayList
protected ModelDef.HashArrayList()
add
public boolean add(E element)
- Specified by:
add in interface Collection<E>- Specified by:
add in interface List<E>- Overrides:
add in class ArrayList<E>
add
public void add(int idx,
E element)
- Specified by:
add in interface List<E>- Overrides:
add in class ArrayList<E>
remove
public E remove(int idx)
- Specified by:
remove in interface List<E>- Overrides:
remove in class ArrayList<E>
clear
public void clear()
- Specified by:
clear in interface Collection<E>- Specified by:
clear in interface List<E>- Overrides:
clear in class ArrayList<E>
indexOf
public int indexOf(Object obj)
- Specified by:
indexOf in interface List<E>- Overrides:
indexOf in class ArrayList<E>
contains
public boolean contains(Object obj)
- Specified by:
contains in interface Collection<E>- Specified by:
contains in interface List<E>- Overrides:
contains in class ArrayList<E>
remove
public boolean remove(Object obj)
- Specified by:
remove in interface Collection<E>- Specified by:
remove in interface List<E>- Overrides:
remove in class ArrayList<E>
remapFrom
protected void remapFrom(int idx)