org.dishevelled.observable
Class AbstractSortedSetDecorator<E>

java.lang.Object
  extended by org.dishevelled.observable.AbstractSortedSetDecorator<E>
Type Parameters:
E - sorted set element type
All Implemented Interfaces:
Iterable<E>, Collection<E>, Set<E>, SortedSet<E>
Direct Known Subclasses:
AbstractObservableSortedSet

abstract class AbstractSortedSetDecorator<E>
extends Object
implements SortedSet<E>

Abstract set that decorates an instance of SortedSet.

Version:
$Revision$ $Date$
Author:
Michael Heuer

Constructor Summary
protected AbstractSortedSetDecorator(SortedSet<E> sortedSet)
          Create a new abstract sorted set that decorates the specified sorted set.
 
Method Summary
 boolean add(E e)
          
 boolean addAll(Collection<? extends E> c)
          
 void clear()
          
 Comparator<? super E> comparator()
          
 boolean contains(Object o)
          
 boolean containsAll(Collection<?> c)
          
 boolean equals(Object o)
          
 E first()
          
protected  SortedSet<E> getSortedSet()
          Return a reference to the sorted set this decorator decorates.
 int hashCode()
          
 SortedSet<E> headSet(E toElement)
          
 boolean isEmpty()
          
 Iterator<E> iterator()
          
 E last()
          
 boolean remove(Object o)
          
 boolean removeAll(Collection<?> c)
          
 boolean retainAll(Collection<?> c)
          
 int size()
          
 SortedSet<E> subSet(E fromElement, E toElement)
          
 SortedSet<E> tailSet(E fromElement)
          
 Object[] toArray()
          
<T> T[]
toArray(T[] a)
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractSortedSetDecorator

protected AbstractSortedSetDecorator(SortedSet<E> sortedSet)
Create a new abstract sorted set that decorates the specified sorted set.

Parameters:
sortedSet - sorted set to decorate, must not be null
Method Detail

getSortedSet

protected final SortedSet<E> getSortedSet()
Return a reference to the sorted set this decorator decorates.

Returns:
a reference to the sorted set this decorator decorates

comparator

public Comparator<? super E> comparator()

Specified by:
comparator in interface SortedSet<E>

first

public E first()

Specified by:
first in interface SortedSet<E>

headSet

public SortedSet<E> headSet(E toElement)

Specified by:
headSet in interface SortedSet<E>

last

public E last()

Specified by:
last in interface SortedSet<E>

subSet

public SortedSet<E> subSet(E fromElement,
                           E toElement)

Specified by:
subSet in interface SortedSet<E>

tailSet

public SortedSet<E> tailSet(E fromElement)

Specified by:
tailSet in interface SortedSet<E>

add

public boolean add(E e)

Specified by:
add in interface Collection<E>
Specified by:
add in interface Set<E>

addAll

public boolean addAll(Collection<? extends E> c)

Specified by:
addAll in interface Collection<E>
Specified by:
addAll in interface Set<E>

clear

public void clear()

Specified by:
clear in interface Collection<E>
Specified by:
clear in interface Set<E>

contains

public boolean contains(Object o)

Specified by:
contains in interface Collection<E>
Specified by:
contains in interface Set<E>

containsAll

public boolean containsAll(Collection<?> c)

Specified by:
containsAll in interface Collection<E>
Specified by:
containsAll in interface Set<E>

equals

public boolean equals(Object o)

Specified by:
equals in interface Collection<E>
Specified by:
equals in interface Set<E>
Overrides:
equals in class Object

hashCode

public int hashCode()

Specified by:
hashCode in interface Collection<E>
Specified by:
hashCode in interface Set<E>
Overrides:
hashCode in class Object

isEmpty

public boolean isEmpty()

Specified by:
isEmpty in interface Collection<E>
Specified by:
isEmpty in interface Set<E>

iterator

public Iterator<E> iterator()

Specified by:
iterator in interface Iterable<E>
Specified by:
iterator in interface Collection<E>
Specified by:
iterator in interface Set<E>

remove

public boolean remove(Object o)

Specified by:
remove in interface Collection<E>
Specified by:
remove in interface Set<E>

removeAll

public boolean removeAll(Collection<?> c)

Specified by:
removeAll in interface Collection<E>
Specified by:
removeAll in interface Set<E>

retainAll

public boolean retainAll(Collection<?> c)

Specified by:
retainAll in interface Collection<E>
Specified by:
retainAll in interface Set<E>

size

public int size()

Specified by:
size in interface Collection<E>
Specified by:
size in interface Set<E>

toArray

public Object[] toArray()

Specified by:
toArray in interface Collection<E>
Specified by:
toArray in interface Set<E>

toArray

public <T> T[] toArray(T[] a)

Specified by:
toArray in interface Collection<E>
Specified by:
toArray in interface Set<E>


Copyright (c) 2003-2012 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).