org.ujmp.core.collections
Class ArrayIndexList<M>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<M>
org.ujmp.core.collections.ArrayIndexList<M>
- Type Parameters:
M
- Type of the elements in the list
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<M>, Collection<M>, List<M>, RandomAccess
public class ArrayIndexList<M>
- extends 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()
- Author:
- Holger Arndt
- See Also:
- Serialized Form
ArrayIndexList
public ArrayIndexList()
ArrayIndexList
public ArrayIndexList(Collection<? extends M> c)
add
public void add(int index,
M element)
- Specified by:
add
in interface List<M>
- Overrides:
add
in class ArrayList<M>
add
public boolean add(M e)
- Specified by:
add
in interface Collection<M>
- Specified by:
add
in interface List<M>
- Overrides:
add
in class ArrayList<M>
addAll
public boolean addAll(Collection<? extends M> c)
- Specified by:
addAll
in interface Collection<M>
- Specified by:
addAll
in interface List<M>
- Overrides:
addAll
in class ArrayList<M>
addAll
public boolean addAll(int index,
Collection<? extends M> c)
- Specified by:
addAll
in interface List<M>
- Overrides:
addAll
in class ArrayList<M>
clear
public void clear()
- Specified by:
clear
in interface Collection<M>
- Specified by:
clear
in interface List<M>
- Overrides:
clear
in class ArrayList<M>
contains
public boolean contains(Object o)
- Specified by:
contains
in interface Collection<M>
- Specified by:
contains
in interface List<M>
- Overrides:
contains
in class ArrayList<M>
indexOf
public int indexOf(Object o)
- Specified by:
indexOf
in interface List<M>
- Overrides:
indexOf
in class ArrayList<M>
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOf
in interface List<M>
- Overrides:
lastIndexOf
in class ArrayList<M>
remove
public M remove(int index)
- Specified by:
remove
in interface List<M>
- Overrides:
remove
in class ArrayList<M>
remove
public boolean remove(Object o)
- Specified by:
remove
in interface Collection<M>
- Specified by:
remove
in interface List<M>
- Overrides:
remove
in class ArrayList<M>
set
public M set(int index,
M element)
- Specified by:
set
in interface List<M>
- Overrides:
set
in class ArrayList<M>
Copyright © 2010. All Rights Reserved.