org.rightcollections.impl
Class RightListImpl<E>

java.lang.Object
  extended by org.rightcollections.impl.AbstractRightCollection<E>
      extended by org.rightcollections.impl.RightListImpl<E>
Type Parameters:
E - type of elements in list.
All Implemented Interfaces:
java.lang.Iterable<E>, java.util.Collection<E>, java.util.List<E>, Closurable<E>, Filterable<E>, MaxCalculator<E>, RightCollection<E>, RightList<E>

public class RightListImpl<E>
extends AbstractRightCollection<E>
implements RightList<E>

Implementation of central interface of framework.

Author:
Ruslan Pilin

Constructor Summary
RightListImpl()
           
RightListImpl(java.util.List<E> list)
           
 
Method Summary
 boolean add(E e)
           
 void add(int index, E element)
           
 boolean addAll(java.util.Collection<? extends E> c)
           
 boolean addAll(int index, java.util.Collection<? extends E> c)
           
 void clear()
           
 boolean contains(java.lang.Object o)
           
 boolean containsAll(java.util.Collection<?> c)
           
<C extends RightCollection<E>>
C
createRightCollection()
           
 boolean equals(java.lang.Object o)
           
 E get(int index)
           
 java.util.Collection<E> getCollection()
          Method for implementing by subclasses have to return collection to delegate all collection methods to.
 int hashCode()
           
 int indexOf(java.lang.Object o)
           
 boolean isEmpty()
           
 java.util.Iterator<E> iterator()
           
 int lastIndexOf(java.lang.Object o)
           
 java.util.ListIterator<E> listIterator()
           
 java.util.ListIterator<E> listIterator(int index)
           
 E remove(int index)
           
 boolean remove(java.lang.Object o)
           
 boolean removeAll(java.util.Collection<?> c)
           
 boolean retainAll(java.util.Collection<?> c)
           
 E set(int index, E element)
           
 int size()
           
 java.util.List<E> subList(int fromIndex, int toIndex)
           
 java.lang.Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 
Methods inherited from class org.rightcollections.impl.AbstractRightCollection
execute, filter, max, max
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.rightcollections.Closurable
execute
 
Methods inherited from interface org.rightcollections.Filterable
filter
 
Methods inherited from interface org.rightcollections.MaxCalculator
max, max
 

Constructor Detail

RightListImpl

public RightListImpl(java.util.List<E> list)

RightListImpl

public RightListImpl()
Method Detail

createRightCollection

public <C extends RightCollection<E>> C createRightCollection()

getCollection

public java.util.Collection<E> getCollection()
Description copied from class: AbstractRightCollection
Method for implementing by subclasses have to return collection to delegate all collection methods to.

Specified by:
getCollection in class AbstractRightCollection<E>
Returns:
internal collection.

add

public boolean add(E e)
Specified by:
add in interface java.util.Collection<E>
Specified by:
add in interface java.util.List<E>
Overrides:
add in class AbstractRightCollection<E>
Parameters:
e - element
Returns:
true if this collection changed as a result of the call
See Also:
Collection.add(java.lang.Object)

add

public void add(int index,
                E element)
Specified by:
add in interface java.util.List<E>

addAll

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

addAll

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

clear

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

contains

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

containsAll

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

equals

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

get

public E get(int index)
Specified by:
get in interface java.util.List<E>

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Collection<E>
Specified by:
hashCode in interface java.util.List<E>
Overrides:
hashCode in class AbstractRightCollection<E>
See Also:
Object.hashCode()

indexOf

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

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection<E>
Specified by:
isEmpty in interface java.util.List<E>
Overrides:
isEmpty in class AbstractRightCollection<E>
See Also:
Collection.isEmpty()

iterator

public java.util.Iterator<E> iterator()
Specified by:
iterator in interface java.lang.Iterable<E>
Specified by:
iterator in interface java.util.Collection<E>
Specified by:
iterator in interface java.util.List<E>
Overrides:
iterator in class AbstractRightCollection<E>
See Also:
Collection.iterator()

lastIndexOf

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

listIterator

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

listIterator

public java.util.ListIterator<E> listIterator(int index)
Specified by:
listIterator in interface java.util.List<E>

remove

public E remove(int index)
Specified by:
remove in interface java.util.List<E>

remove

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

removeAll

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

retainAll

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

set

public E set(int index,
             E element)
Specified by:
set in interface java.util.List<E>

size

public int size()
Specified by:
size in interface java.util.Collection<E>
Specified by:
size in interface java.util.List<E>
Overrides:
size in class AbstractRightCollection<E>
See Also:
Collection.size()

subList

public java.util.List<E> subList(int fromIndex,
                                 int toIndex)
Specified by:
subList in interface java.util.List<E>

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection<E>
Specified by:
toArray in interface java.util.List<E>
Overrides:
toArray in class AbstractRightCollection<E>
See Also:
Collection.toArray()

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface java.util.Collection<E>
Specified by:
toArray in interface java.util.List<E>
Overrides:
toArray in class AbstractRightCollection<E>
See Also:
java.util.Collection#toArray(T[])


Copyright © 2009 Ruslan Pilin. All Rights Reserved.