org.mmbase.bridge.implementation
Class BasicList<E extends Comparable<? super E>>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by org.mmbase.bridge.implementation.BasicList<E>
All Implemented Interfaces:
Serializable, Iterable<E>, Collection<E>, List<E>, RandomAccess, BridgeList<E>
Direct Known Subclasses:
AbstractNodeList, BasicFieldList, BasicModuleList, BasicStringList

public class BasicList<E extends Comparable<? super E>>
extends AbstractList<E>
implements BridgeList<E>, Serializable, RandomAccess

A list of objects. This is the base class for all basic implementations of the bridge lists.

Version:
$Id: BasicList.java 41967 2010-04-20 09:41:20Z michiel $
Author:
Pierre van Rooden, Michiel Meeuwissen
See Also:
Serialized Form

Nested Class Summary
protected  class BasicList.BasicIterator
           
 
Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
(package private) BasicList()
           
  BasicList(BridgeList<? extends E> b)
           
protected BasicList(Collection c)
           
 
Method Summary
 void add(int i, E e)
           
protected  E convert(Object o)
          converts the object in the list to the excpected format
protected  E convert(Object o, int index)
           
protected  void convertAll()
           
 E get(int i)
           
 Map<Object,Object> getProperties()
          Returns an (unmodifiable) view on all properties of this list (See BridgeList.getProperty(java.lang.Object)).
 Object getProperty(Object key)
          Retrieves a property previously set for this list.
 E remove(int i)
           
 E set(int i, E e)
           
 void setProperty(Object key, Object value)
          Sets a property for this list.
 int size()
           
 void sort()
          Sorts this list according to a default sort order.
 void sort(Comparator<? super E> comparator)
          Sorts this list according to a specified sort order
 BridgeList<E> subList(int fromIndex, int toIndex)
           
 Object[] toArray()
           
 
Methods inherited from class java.util.AbstractList
add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, removeAll, retainAll, toArray
 

Constructor Detail

BasicList

BasicList()

BasicList

protected BasicList(Collection c)

BasicList

public BasicList(BridgeList<? extends E> b)
Since:
MMBase-1.9.4
Method Detail

getProperty

public Object getProperty(Object key)
Description copied from interface: BridgeList
Retrieves a property previously set for this list. Use this to store and retrieve meta data on how the list was created (such as what sort-order was specified)

Specified by:
getProperty in interface BridgeList<E extends Comparable<? super E>>
Parameters:
key - the key of the property
Returns:
the property value

setProperty

public void setProperty(Object key,
                        Object value)
Description copied from interface: BridgeList
Sets a property for this list. Use this to store and retrieve meta data on how the list was created (such as what sort-order was specified)

Specified by:
setProperty in interface BridgeList<E extends Comparable<? super E>>
Parameters:
key - the key of the property
value - the property value

getProperties

public Map<Object,Object> getProperties()
Description copied from interface: BridgeList
Returns an (unmodifiable) view on all properties of this list (See BridgeList.getProperty(java.lang.Object)).

Specified by:
getProperties in interface BridgeList<E extends Comparable<? super E>>

convert

protected E convert(Object o)
converts the object in the list to the excpected format


convert

protected final E convert(Object o,
                          int index)

get

public E get(int i)
Specified by:
get in interface List<E extends Comparable<? super E>>
Specified by:
get in class AbstractList<E extends Comparable<? super E>>

size

public int size()
Specified by:
size in interface Collection<E extends Comparable<? super E>>
Specified by:
size in interface List<E extends Comparable<? super E>>
Specified by:
size in class AbstractCollection<E extends Comparable<? super E>>

set

public E set(int i,
             E e)
Specified by:
set in interface List<E extends Comparable<? super E>>
Overrides:
set in class AbstractList<E extends Comparable<? super E>>

add

public void add(int i,
                E e)
Specified by:
add in interface List<E extends Comparable<? super E>>
Overrides:
add in class AbstractList<E extends Comparable<? super E>>

remove

public E remove(int i)
Specified by:
remove in interface List<E extends Comparable<? super E>>
Overrides:
remove in class AbstractList<E extends Comparable<? super E>>

sort

public void sort()
Description copied from interface: BridgeList
Sorts this list according to a default sort order.

Specified by:
sort in interface BridgeList<E extends Comparable<? super E>>

sort

public void sort(Comparator<? super E> comparator)
Description copied from interface: BridgeList
Sorts this list according to a specified sort order

Specified by:
sort in interface BridgeList<E extends Comparable<? super E>>
Parameters:
comparator - the comparator defining the sort order

convertAll

protected void convertAll()
Since:
MMBase-1.6.2

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<E extends Comparable<? super E>>
Specified by:
toArray in interface List<E extends Comparable<? super E>>
Overrides:
toArray in class AbstractCollection<E extends Comparable<? super E>>

subList

public BridgeList<E> subList(int fromIndex,
                             int toIndex)
Specified by:
subList in interface List<E extends Comparable<? super E>>
Specified by:
subList in interface BridgeList<E extends Comparable<? super E>>
Overrides:
subList in class AbstractList<E extends Comparable<? super E>>


MMBase 2.0-SNAPSHOT - null