nl.knowledgeplaza.util
Class SortedSet

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet
          extended by nl.knowledgeplaza.util.SortedSet
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.Set

public class SortedSet
extends java.util.AbstractSet
implements java.lang.Cloneable, java.io.Serializable

SortedSet is a simplistic light-weight Set designed for use when the number of entries is small. It is backed by a List. Unlike TreeSet it allows NULL to be added

Version:
$Revision: 1.2 $
Author:
$Author: toeukpap $
See Also:
Serialized Form

Constructor Summary
SortedSet()
          Creates a LinearSet.
SortedSet(java.util.Collection collection)
          Creates a LinearSet, filling it with the elements of set.
SortedSet(java.util.Comparator comparator)
          Creates a LinearSet.
SortedSet(int capacity)
          Creates a LinearSet with given capacity.
 
Method Summary
 boolean add(int pos, java.lang.Object o)
           
 boolean add(java.lang.Object o)
           
 boolean addAll(java.util.Collection c)
           
 java.lang.Object clone()
           
 java.lang.Object get(int pos)
           
 java.util.Iterator iterator()
           
 boolean remove(java.lang.Object o)
           
 int size()
           
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
clear, contains, containsAll, isEmpty, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
clear, contains, containsAll, isEmpty, retainAll, toArray, toArray
 

Constructor Detail

SortedSet

public SortedSet()
Creates a LinearSet. Uses an ArrayList as the backing store.


SortedSet

public SortedSet(java.util.Comparator comparator)
Creates a LinearSet. Uses an ArrayList as the backing store.


SortedSet

public SortedSet(int capacity)
Creates a LinearSet with given capacity. Uses an ArrayList as the backing store.


SortedSet

public SortedSet(java.util.Collection collection)
Creates a LinearSet, filling it with the elements of set. Uses an ArrayList as the backing store.

Method Detail

add

public boolean add(int pos,
                   java.lang.Object o)

add

public boolean add(java.lang.Object o)
Specified by:
add in interface java.util.Collection
Specified by:
add in interface java.util.Set
Overrides:
add in class java.util.AbstractCollection

addAll

public boolean addAll(java.util.Collection c)
Specified by:
addAll in interface java.util.Collection
Specified by:
addAll in interface java.util.Set
Overrides:
addAll in class java.util.AbstractCollection

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

get

public java.lang.Object get(int pos)

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface java.lang.Iterable
Specified by:
iterator in interface java.util.Collection
Specified by:
iterator in interface java.util.Set
Specified by:
iterator in class java.util.AbstractCollection

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.Collection
Specified by:
remove in interface java.util.Set
Overrides:
remove in class java.util.AbstractCollection

size

public int size()
Specified by:
size in interface java.util.Collection
Specified by:
size in interface java.util.Set
Specified by:
size in class java.util.AbstractCollection


Copyright © 2010. All Rights Reserved.