nl.knowledgeplaza.util
Class LinearSet<T>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<T>
nl.knowledgeplaza.util.LinearSet<T>
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable<T>, Collection<T>, Set<T>
public class LinearSet<T>
- extends AbstractSet<T>
- implements Cloneable, Serializable
LinearSet is a simplistic light-weight
Set designed for use when the number of entries is
small. It is backed by a List.
- Version:
- $Revision: 1.2 $
- Author:
- $Author: toeukpap $
- See Also:
- Serialized Form
|
Constructor Summary |
LinearSet()
Creates a LinearSet. |
LinearSet(Collection collection)
Creates a LinearSet, filling it with the elements
of set. |
LinearSet(int capacity)
Creates a LinearSet with given capacity. |
LinearSet
public LinearSet()
- Creates a
LinearSet. Uses an
ArrayList as the backing store.
LinearSet
public LinearSet(int capacity)
- Creates a
LinearSet with given capacity.
Uses an ArrayList as the backing store.
LinearSet
public LinearSet(Collection collection)
- Creates a
LinearSet, filling it with the elements
of set. Uses an ArrayList as the
backing store.
add
public boolean add(int pos,
T o)
add
public boolean add(T o)
- Specified by:
add in interface Collection<T>- Specified by:
add in interface Set<T>- Overrides:
add in class AbstractCollection<T>
addAll
public boolean addAll(Collection<? extends T> c)
- Specified by:
addAll in interface Collection<T>- Specified by:
addAll in interface Set<T>- Overrides:
addAll in class AbstractCollection<T>
clone
public Object clone()
- Overrides:
clone in class Object
get
public T get(int pos)
iterator
public Iterator<T> iterator()
- Specified by:
iterator in interface Iterable<T>- Specified by:
iterator in interface Collection<T>- Specified by:
iterator in interface Set<T>- Specified by:
iterator in class AbstractCollection<T>
remove
public boolean remove(Object o)
- Specified by:
remove in interface Collection<T>- Specified by:
remove in interface Set<T>- Overrides:
remove in class AbstractCollection<T>
size
public int size()
- Specified by:
size in interface Collection<T>- Specified by:
size in interface Set<T>- Specified by:
size in class AbstractCollection<T>
Copyright © 2011 KnowledgePlaza. All Rights Reserved.