org.sonatype.sisu.jacksbee.runtime
Class UniqueList<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by org.sonatype.sisu.jacksbee.runtime.UniqueList<E>
All Implemented Interfaces:
Iterable<E>, Collection<E>, List<E>

public class UniqueList<E>
extends AbstractList<E>

A List which only allows unique elements; similar to Set but typed as List.

Since:
1.0

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
UniqueList()
           
UniqueList(List<E> delegate)
           
 
Method Summary
 void add(int index, E element)
           
 boolean contains(Object obj)
           
static
<T> UniqueList<T>
create()
           
static
<T> UniqueList<T>
create(Iterable<? extends T> elements)
           
 boolean equals(Object obj)
           
 E get(int index)
           
 int hashCode()
           
 E remove(int index)
           
 E set(int index, E element)
           
 int size()
           
 String toString()
           
 
Methods inherited from class java.util.AbstractList
add, addAll, clear, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

UniqueList

public UniqueList(List<E> delegate)

UniqueList

public UniqueList()
Method Detail

create

public static <T> UniqueList<T> create()

create

public static <T> UniqueList<T> create(Iterable<? extends T> elements)

contains

public boolean contains(Object obj)
Specified by:
contains in interface Collection<E>
Specified by:
contains in interface List<E>
Overrides:
contains in class AbstractCollection<E>

get

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

size

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

set

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

add

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

remove

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

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection<E>
Specified by:
hashCode in interface List<E>
Overrides:
hashCode in class AbstractList<E>

equals

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

toString

public String toString()
Overrides:
toString in class AbstractCollection<E>


Copyright © 2008-2012 Sonatype, Inc.. All Rights Reserved.