org.omnaest.utils.structure.collection.list
Class IdentityArrayList<E>

java.lang.Object
  extended by org.omnaest.utils.structure.collection.CollectionAbstract<E>
      extended by org.omnaest.utils.structure.collection.list.ListAbstract<E>
          extended by 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

Nested Class Summary
 
Nested classes/interfaces inherited from class org.omnaest.utils.structure.collection.list.ListAbstract
ListAbstract.ListAbstractSublist<E>
 
Field Summary
protected  List<E> list
           
 
Constructor Summary
IdentityArrayList()
           
IdentityArrayList(Collection<E> collection)
           
 
Method Summary
 boolean add(E e)
           
 void add(int index, E element)
           
 void clear()
           
 E get(int index)
           
 int indexOf(Object o)
           
 int lastIndexOf(Object o)
           
 E remove(int index)
           
 E set(int index, E element)
           
 int size()
           
 String toString()
           
 
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
 
Methods inherited from class org.omnaest.utils.structure.collection.CollectionAbstract
addAll, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray
 

Field Detail

list

protected List<E> list
Constructor Detail

IdentityArrayList

public IdentityArrayList(Collection<E> collection)
Parameters:
collection -

IdentityArrayList

public IdentityArrayList()
Method Detail

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.