org.omnaest.utils.structure.collection.list.sorted
Class TreeList.ElementList

java.lang.Object
  extended by org.omnaest.utils.structure.collection.list.decorator.ListDecorator<E>
      extended by org.omnaest.utils.structure.collection.list.sorted.TreeList.ElementList
All Implemented Interfaces:
Serializable, Iterable<E>, Collection<E>, List<E>, AccessorReadable<E>
Enclosing class:
TreeList<E>

protected class TreeList.ElementList
extends ListDecorator<E>
implements AccessorReadable<E>

An TreeList.ElementList is based on an regular ArrayList but additionally removes itself from the underlying SortedMap if its last element is removed and the List is going to get empty.

And it represents an AccessorReadable for the first element of the List to allow sorting.

Author:
Omnaest
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.omnaest.utils.structure.collection.list.decorator.ListDecorator
list
 
Constructor Summary
TreeList.ElementList()
           
 
Method Summary
 void clear()
           
 E getElement()
          Returns the element the AccessorReadable does point to
protected  E getFirstElement()
           
 E remove(int index)
           
 boolean remove(Object o)
           
 boolean removeAll(Collection<?> c)
           
 boolean retainAll(Collection<?> c)
           
 
Methods inherited from class org.omnaest.utils.structure.collection.list.decorator.ListDecorator
add, add, addAll, addAll, contains, containsAll, equals, get, getList, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, set, setList, size, subList, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TreeList.ElementList

public TreeList.ElementList()
See Also:
TreeList.ElementList
Method Detail

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<E>
Specified by:
remove in interface List<E>
Overrides:
remove in class ListDecorator<E>
See Also:
List.remove(java.lang.Object)

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<E>
Specified by:
removeAll in interface List<E>
Overrides:
removeAll in class ListDecorator<E>
See Also:
List.removeAll(java.util.Collection)

retainAll

public boolean retainAll(Collection<?> c)
Specified by:
retainAll in interface Collection<E>
Specified by:
retainAll in interface List<E>
Overrides:
retainAll in class ListDecorator<E>
See Also:
List.retainAll(java.util.Collection)

remove

public E remove(int index)
Specified by:
remove in interface List<E>
Overrides:
remove in class ListDecorator<E>
See Also:
List.remove(int)

getFirstElement

protected E getFirstElement()
Returns:

getElement

public E getElement()
Description copied from interface: AccessorReadable
Returns the element the AccessorReadable does point to

Specified by:
getElement in interface AccessorReadable<E>
Returns:

clear

public void clear()
Specified by:
clear in interface Collection<E>
Specified by:
clear in interface List<E>
Overrides:
clear in class ListDecorator<E>
See Also:
List.clear()


Copyright © 2013. All Rights Reserved.