org.chromattic.common.collection
Class WrappedArrayList<E,A>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by org.chromattic.common.collection.WrappedArrayList<E,A>
All Implemented Interfaces:
Iterable<E>, Collection<E>, List<E>

public abstract class WrappedArrayList<E,A>
extends AbstractList<E>

Version:
$Revision$
Author:
Julien Viet

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
protected WrappedArrayList(A array)
           
 
Method Summary
static
<E,A> WrappedArrayList<E,A>
create(Class<E> elementType, Class<?> componentType, int size)
           
protected abstract  E get(A array, int index)
           
 E get(int index)
           
 A getArray()
           
protected abstract  void set(A array, int index, E element)
           
 E set(int index, E element)
           
 int size()
           
protected abstract  int size(A array)
           
static
<E,A> WrappedArrayList<E,A>
wrap(Class<E> elementType, Object array)
           
 
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

WrappedArrayList

protected WrappedArrayList(A array)
                    throws NullPointerException
Throws:
NullPointerException
Method Detail

create

public static <E,A> WrappedArrayList<E,A> create(Class<E> elementType,
                                                 Class<?> componentType,
                                                 int size)

wrap

public static <E,A> WrappedArrayList<E,A> wrap(Class<E> elementType,
                                               Object array)

get

protected abstract E get(A array,
                         int index)

set

protected abstract void set(A array,
                            int index,
                            E element)

size

protected abstract int size(A array)

getArray

public final A getArray()

get

public final E get(int index)
Specified by:
get in interface List<E>
Specified by:
get in class AbstractList<E>

set

public final E set(int index,
                   E element)
Specified by:
set in interface List<E>
Overrides:
set in class AbstractList<E>

size

public final int size()
Specified by:
size in interface Collection<E>
Specified by:
size in interface List<E>
Specified by:
size in class AbstractCollection<E>


Copyright © 2009 eXo Platform SAS. All Rights Reserved.