org.apache.commons.collections.primitives.adapters
Class CharListList

java.lang.Object
  extended by org.apache.commons.collections.primitives.adapters.CharListList
All Implemented Interfaces:
Serializable, Iterable, Collection, List

public final class CharListList
extends Object
implements Serializable

Adapts an CharList to the List interface.

This implementation delegates most methods to the provided CharList implementation in the "obvious" way.

Since:
Commons Primitives 1.0
Version:
$Revision: 480462 $ $Date: 2006-11-29 09:15:00 +0100(mer, 29 nov 2006) $
Author:
Rodney Waldhoff
See Also:
Serialized Form

Constructor Summary
CharListList(CharList list)
          Creates a List wrapping the specified CharList.
 
Method Summary
 void add(int index, Object element)
           
 boolean add(Object element)
           
 boolean addAll(Collection c)
           
 boolean addAll(int index, Collection c)
           
 void clear()
           
 boolean contains(Object element)
           
 boolean containsAll(Collection c)
           
 boolean equals(Object obj)
           
 Object get(int index)
           
protected  CharCollection getCharCollection()
           
protected  CharList getCharList()
           
 int hashCode()
           
 int indexOf(Object element)
           
 boolean isEmpty()
           
 Iterator iterator()
          wraps the CharIterator returned by my underlying CharCollection, if any.
 int lastIndexOf(Object element)
           
 ListIterator listIterator()
          wraps the CharListIterator returned by my underlying CharList, if any.
 ListIterator listIterator(int index)
          wraps the CharListIterator returned by my underlying CharList, if any.
 Object remove(int index)
           
 boolean remove(Object element)
           
 boolean removeAll(Collection c)
           
 boolean retainAll(Collection c)
           
 Object set(int index, Object element)
           
 int size()
           
 List subList(int fromIndex, int toIndex)
           
 Object[] toArray()
           
 Object[] toArray(Object[] A)
           
 String toString()
           
static List wrap(CharList list)
          Create a List wrapping the specified CharList.
 
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, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Constructor Detail

CharListList

public CharListList(CharList list)
Creates a List wrapping the specified CharList.

See Also:
wrap(org.apache.commons.collections.primitives.CharList)
Method Detail

wrap

public static List wrap(CharList list)
Create a List wrapping the specified CharList. When the given list is null, returns null.

Parameters:
list - the (possibly null) CharList to wrap
Returns:
a List wrapping the given list, or null when list is null.

getCharList

protected CharList getCharList()

add

public void add(int index,
                Object element)
Specified by:
add in interface List

addAll

public boolean addAll(int index,
                      Collection c)
Specified by:
addAll in interface List

get

public Object get(int index)
Specified by:
get in interface List

indexOf

public int indexOf(Object element)
Specified by:
indexOf in interface List

lastIndexOf

public int lastIndexOf(Object element)
Specified by:
lastIndexOf in interface List

listIterator

public ListIterator listIterator()
wraps the CharListIterator returned by my underlying CharList, if any.

Specified by:
listIterator in interface List

listIterator

public ListIterator listIterator(int index)
wraps the CharListIterator returned by my underlying CharList, if any.

Specified by:
listIterator in interface List

remove

public Object remove(int index)
Specified by:
remove in interface List

set

public Object set(int index,
                  Object element)
Specified by:
set in interface List

subList

public List subList(int fromIndex,
                    int toIndex)
Specified by:
subList in interface List

equals

public boolean equals(Object obj)
Specified by:
equals in interface Collection
Specified by:
equals in interface List
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection
Specified by:
hashCode in interface List
Overrides:
hashCode in class Object

getCharCollection

protected final CharCollection getCharCollection()

add

public boolean add(Object element)
Specified by:
add in interface Collection

addAll

public boolean addAll(Collection c)
Specified by:
addAll in interface Collection

clear

public void clear()
Specified by:
clear in interface Collection

contains

public boolean contains(Object element)
Specified by:
contains in interface Collection

containsAll

public boolean containsAll(Collection c)
Specified by:
containsAll in interface Collection

toString

public String toString()
Overrides:
toString in class Object

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection

iterator

public Iterator iterator()
wraps the CharIterator returned by my underlying CharCollection, if any.

Specified by:
iterator in interface Iterable
Specified by:
iterator in interface Collection

remove

public boolean remove(Object element)
Specified by:
remove in interface Collection

removeAll

public boolean removeAll(Collection c)
Specified by:
removeAll in interface Collection

retainAll

public boolean retainAll(Collection c)
Specified by:
retainAll in interface Collection

size

public int size()
Specified by:
size in interface Collection

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection

toArray

public Object[] toArray(Object[] A)
Specified by:
toArray in interface Collection


Copyright © 2002-2011 Apache Software Foundation. All Rights Reserved.