JUtil

net.cscott.jutil
Class ListWrapper<E>

java.lang.Object
  extended by net.cscott.jutil.CollectionWrapper<E>
      extended by net.cscott.jutil.ListWrapper<E>
All Implemented Interfaces:
Iterable<E>, Collection<E>, List<E>

public abstract class ListWrapper<E>
extends CollectionWrapper<E>
implements List<E>

ListWrapper is an abstract class designed to make it easier to write wrappers around Lists.

Version:
$Id: ListWrapper.java,v 1.4 2006-10-30 19:58:06 cananian Exp $
Author:
Felix S. Klock II

Constructor Summary
protected ListWrapper()
          Creates a ListWrapper.
 
Method Summary
 void add(int i, E o)
           
 boolean addAll(int i, Collection<? extends E> c)
           
 E get(int i)
           
 int indexOf(Object o)
           
 int lastIndexOf(Object o)
           
 ListIterator<E> listIterator()
           
 ListIterator<E> listIterator(int i)
           
 E remove(int i)
           
 E set(int i, E o)
           
 List<E> subList(int i, int j)
           
protected abstract  List<E> wrapped()
          Implementations should return the wrapped List here.
 
Methods inherited from class net.cscott.jutil.CollectionWrapper
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, 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
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Constructor Detail

ListWrapper

protected ListWrapper()
Creates a ListWrapper.

Method Detail

wrapped

protected abstract List<E> wrapped()
Implementations should return the wrapped List here.

Specified by:
wrapped in class CollectionWrapper<E>

subList

public List<E> subList(int i,
                       int j)
Specified by:
subList in interface List<E>

get

public E get(int i)
Specified by:
get in interface List<E>

set

public E set(int i,
             E o)
Specified by:
set in interface List<E>

remove

public E remove(int i)
Specified by:
remove in interface List<E>

listIterator

public ListIterator<E> listIterator(int i)
Specified by:
listIterator in interface List<E>

listIterator

public ListIterator<E> listIterator()
Specified by:
listIterator in interface List<E>

lastIndexOf

public int lastIndexOf(Object o)
Specified by:
lastIndexOf in interface List<E>

indexOf

public int indexOf(Object o)
Specified by:
indexOf in interface List<E>

addAll

public boolean addAll(int i,
                      Collection<? extends E> c)
Specified by:
addAll in interface List<E>

add

public void add(int i,
                E o)
Specified by:
add in interface List<E>

JUtil

Copyright (c) 2006 C. Scott Ananian