|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractSet
tyrex.util.ArraySet
public class ArraySet
Implementation of a simple Set based on an array. Does not allow multiple entries, does not support null entries.
| Nested Class Summary | |
|---|---|
protected class |
ArraySet.ArraySetIterator
AbstractSet requires an implementation for the iterator. |
| Field Summary | |
|---|---|
protected java.lang.Object[] |
_table
The table of all objects in this set. |
| Constructor Summary | |
|---|---|
ArraySet()
Construct a new empty set. |
|
ArraySet(java.util.Collection collection)
Construct a new set from the specified set and linked to a subject. |
|
| Method Summary | |
|---|---|
boolean |
add(java.lang.Object obj)
|
boolean |
addAll(java.util.Collection collection)
Add the items from the specified collection to the set. |
protected boolean |
canAdd(java.lang.Object object)
Return true if the specified argument can be added to the set. |
protected java.lang.Object |
get(int index)
Returns the element at the specified index, or null if the index is out of bounds. |
java.util.Iterator |
iterator()
|
boolean |
remove(java.lang.Object obj)
|
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 |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
|---|
clear, contains, containsAll, isEmpty, retainAll, toArray, toArray |
| Field Detail |
|---|
protected java.lang.Object[] _table
| Constructor Detail |
|---|
public ArraySet()
public ArraySet(java.util.Collection collection)
subject - the subjecttype - the typeset - the set used to populate the created set| Method Detail |
|---|
public java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Setiterator in class java.util.AbstractCollectionpublic int size()
size in interface java.util.Collectionsize in interface java.util.Setsize in class java.util.AbstractCollectionpublic boolean addAll(java.util.Collection collection)
addAll in interface java.util.CollectionaddAll in interface java.util.SetaddAll in class java.util.AbstractCollectioncollection - the collection
public boolean add(java.lang.Object obj)
add in interface java.util.Collectionadd in interface java.util.Setadd in class java.util.AbstractCollectionpublic boolean remove(java.lang.Object obj)
remove in interface java.util.Collectionremove in interface java.util.Setremove in class java.util.AbstractCollectionprotected boolean canAdd(java.lang.Object object)
The default implementation returns true.
object - the object
protected java.lang.Object get(int index)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||