|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet<E>
toxi.util.datatypes.ArraySet<E>
public class ArraySet<E>
An ArrayList implementation of Set. An ArraySet is good for small sets; it has less overhead than a HashSet or a TreeSet.
Constructor Summary | |
---|---|
ArraySet()
Create an empty set (default initial capacity is 3). |
|
ArraySet(java.util.Collection<? extends E> collection)
Create a set containing the items of the collection. |
|
ArraySet(int initialCapacity)
Create an empty set with the specified initial capacity. |
Method Summary | |
---|---|
boolean |
add(E item)
|
boolean |
containsAny(java.util.Collection<?> collection)
True if any member of the collection is also in the ArraySet. |
E |
get(int index)
Get the item at the specified index. |
java.util.Iterator<E> |
iterator()
|
int |
size()
|
Methods inherited from class java.util.AbstractSet |
---|
equals, hashCode, removeAll |
Methods inherited from class java.util.AbstractCollection |
---|
addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Set |
---|
addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray |
Constructor Detail |
---|
public ArraySet()
public ArraySet(java.util.Collection<? extends E> collection)
collection
- the source for the items of the small setpublic ArraySet(int initialCapacity)
initialCapacity
- the initial capacityMethod Detail |
---|
public boolean add(E item)
add
in interface java.util.Collection<E>
add
in interface java.util.Set<E>
add
in class java.util.AbstractCollection<E>
public boolean containsAny(java.util.Collection<?> collection)
collection
- the Collection to check
public E get(int index) throws java.lang.IndexOutOfBoundsException
index
- where the item is located in the ListSet
java.lang.IndexOutOfBoundsException
- if the index is out of boundspublic java.util.Iterator<E> iterator()
iterator
in interface java.lang.Iterable<E>
iterator
in interface java.util.Collection<E>
iterator
in interface java.util.Set<E>
iterator
in class java.util.AbstractCollection<E>
public int size()
size
in interface java.util.Collection<E>
size
in interface java.util.Set<E>
size
in class java.util.AbstractCollection<E>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |