org.ujmp.core.collections.list
Class ArrayIndexList<M>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<M>
-
- org.ujmp.core.collections.list.ArrayIndexList<M>
-
- Type Parameters:
M- Type of the elements in the list
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<M>, java.util.Collection<M>, java.util.List<M>, java.util.RandomAccess
- Direct Known Subclasses:
- Dictionary
public class ArrayIndexList<M> extends java.util.ArrayList<M>ArrayIndexList is like an ArrayList, but keeps track of the indices where objects have been added. This improves the speed of indexOf() and contains()- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description ArrayIndexList()ArrayIndexList(java.util.Collection<? extends M> c)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadd(int index, M element)booleanadd(M e)booleanaddAll(java.util.Collection<? extends M> c)booleanaddAll(int index, java.util.Collection<? extends M> c)voidclear()booleancontains(java.lang.Object o)intindexOf(java.lang.Object o)intlastIndexOf(java.lang.Object o)Mremove(int index)booleanremove(java.lang.Object o)Mset(int index, M element)
-
-
-
Constructor Detail
-
ArrayIndexList
public ArrayIndexList()
-
ArrayIndexList
public ArrayIndexList(java.util.Collection<? extends M> c)
-
-
Method Detail
-
add
public void add(int index, M element)
-
add
public boolean add(M e)
-
addAll
public boolean addAll(java.util.Collection<? extends M> c)
-
addAll
public boolean addAll(int index, java.util.Collection<? extends M> c)
-
clear
public void clear()
-
contains
public boolean contains(java.lang.Object o)
-
indexOf
public int indexOf(java.lang.Object o)
-
lastIndexOf
public int lastIndexOf(java.lang.Object o)
-
remove
public M remove(int index)
-
remove
public boolean remove(java.lang.Object o)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG