org.omnaest.utils.structure.collection.list
Class IdentityArrayList<E>
java.lang.Object
org.omnaest.utils.structure.collection.CollectionAbstract<E>
org.omnaest.utils.structure.collection.list.ListAbstract<E>
org.omnaest.utils.structure.collection.list.IdentityArrayList<E>
- Type Parameters:
E -
- All Implemented Interfaces:
- Serializable, Iterable<E>, Collection<E>, Deque<E>, List<E>, Queue<E>
public class IdentityArrayList<E>
- extends ListAbstract<E>
Uses the "object == element" comparison instead of the equals comparison for methods navigating to the elements from the
List by given element instances.
- Author:
- Omnaest
- See Also:
IdentityHashMap,
indexOf(Object),
lastIndexOf(Object),
ListAbstract.remove(Object),
CollectionAbstract.removeAll(java.util.Collection),
CollectionAbstract.retainAll(java.util.Collection),
ListAbstract.contains(Object),
CollectionAbstract.containsAll(java.util.Collection),
ArrayList,
Serialized Form
| Methods inherited from class org.omnaest.utils.structure.collection.list.ListAbstract |
addAll, addFirst, addLast, contains, descendingIterator, element, getFirst, getLast, isValidIndex, iterator, listIterator, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, subList |
list
protected List<E> list
IdentityArrayList
public IdentityArrayList(Collection<E> collection)
- Parameters:
collection -
IdentityArrayList
public IdentityArrayList()
size
public int size()
- Returns:
- See Also:
List.size()
add
public boolean add(E e)
- Parameters:
e -
- Returns:
- See Also:
List.add(java.lang.Object)
clear
public void clear()
- Specified by:
clear in interface Collection<E>- Specified by:
clear in interface List<E>- Overrides:
clear in class ListAbstract<E>
- See Also:
List.clear()
get
public E get(int index)
- Parameters:
index -
- Returns:
- See Also:
List.get(int)
set
public E set(int index,
E element)
- Parameters:
index - element -
- Returns:
- See Also:
List.set(int, java.lang.Object)
add
public void add(int index,
E element)
- Parameters:
index - element - - See Also:
List.add(int, java.lang.Object)
remove
public E remove(int index)
- Parameters:
index -
- Returns:
- See Also:
List.remove(int)
indexOf
public int indexOf(Object o)
lastIndexOf
public int lastIndexOf(Object o)
toString
public String toString()
- Overrides:
toString in class CollectionAbstract<E>
Copyright © 2013. All Rights Reserved.