|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.walend.collection.AbstractHashSet | +--net.walend.lyophil.collection.AbstractHashSetOfFreezables
An abstract HashSet that includes special methods for handling Freezables. It holds everything in memory, and never returns to the Freezer to thaw an instance. By default it uses the FreezableIdentitor.
Nested Class Summary | |
private class |
AbstractHashSetOfFreezables.IdentifierIterator
|
Field Summary |
Fields inherited from class net.walend.collection.AbstractHashSet |
|
Fields inherited from interface net.walend.lyophil.collection.SetOfFreezables |
EMPTY |
Constructor Summary | |
protected |
AbstractHashSetOfFreezables()
Constructs a new, empty set; the backing MutableHashMap instance has default capacity and load factor, which is 0.75, and uses the FreezableIdentitor. |
protected |
AbstractHashSetOfFreezables(Collection c)
Constructs a new set containing the elements in the specified collection. |
protected |
AbstractHashSetOfFreezables(java.util.Collection c)
Constructs a new set containing the elements in the specified java.util.Collection. |
protected |
AbstractHashSetOfFreezables(Identitor identitor)
Constructs a new, empty set; the backing MutableHashMap instance has default capacity and load factor, which is 0.75. |
protected |
AbstractHashSetOfFreezables(Identitor identitor,
int initialCapacity)
Constructs a new, empty set; the backing MutableHashMap instance has the specified initial capacity and default load factor, which is 0.75. |
protected |
AbstractHashSetOfFreezables(Identitor identitor,
int initialCapacity,
float loadFactor)
Constructs a new, empty set; the backing MutableHashMap instance has the specified initial capacity and the specified load factor. |
protected |
AbstractHashSetOfFreezables(int initialCapacity)
Constructs a new, empty set; the backing MutableHashMap instance has the specified initial capacity and default load factor, which is 0.75. |
protected |
AbstractHashSetOfFreezables(int initialCapacity,
float loadFactor)
Constructs a new, empty set; the backing MutableHashMap instance has the specified initial capacity and the specified load factor. |
Method Summary | |
protected boolean |
add(java.lang.Object o)
Adds the specified element to this set if it is not already present. |
protected boolean |
addAllIdentifiedBy(Collection c)
Adds all the Freezables identified by c to this MutableCollection using the addIdentifier method. |
protected boolean |
addIdentifiedBy(java.io.Serializable id)
Adds a Freezable to the MutableCollection. |
boolean |
containsAllIdentifiedBy(Collection ids)
Returns true if this collection contains the specified Freezables. |
boolean |
containsIdentifiedBy(java.io.Serializable id)
Returns true if this collection contains the specified Freezable. |
FreezableIterator |
freezableIterator()
Returns an iterator over the Freezables in this collection. |
protected Freezable |
getFreezableForID(java.io.Serializable id)
|
protected Freezer |
getFreezer()
|
Collection |
getIdentifiers()
Returns a Collection of all the identifiers in this collection. |
java.util.Iterator |
identifierIterator()
Returns an iterator over the identifiers in this collection. |
protected boolean |
removeAllIdentifiedBy(Collection c)
Removes all the Freezables identified by c from this MutableCollection using the removeIdentifiedBy method. |
protected boolean |
removeIdentifiedBy(java.io.Serializable id)
Removes a Freezable from the MutableCollection, based on that Freezable's identifier. |
protected boolean |
retainAllIdentifiedBy(Collection c)
Removes all but the Freezables identified by c from this MutableCollection using the removeIdentifiedBy method. |
Methods inherited from class net.walend.collection.AbstractHashSet |
addAll, clear, clone, contains, containsAll, getIdentitor, getJavaCollection, getJavaSet, getPrincipleInterface, isEmpty, iterator, remove, removeAll, retainAll, sameContentsAs, sameStateAs, size, toString |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.walend.collection.Collection |
contains, containsAll, getIdentitor, getJavaCollection, isEmpty, iterator, sameContentsAs, size |
Methods inherited from interface net.walend.collection.HasState |
getPrincipleInterface, sameStateAs |
Methods inherited from interface net.walend.collection.Set |
getJavaSet |
Constructor Detail |
protected AbstractHashSetOfFreezables()
protected AbstractHashSetOfFreezables(Collection c)
c
- the collection whose elements are to be placed into this set.protected AbstractHashSetOfFreezables(java.util.Collection c)
c
- the collection whose elements are to be placed into this set.protected AbstractHashSetOfFreezables(int initialCapacity, float loadFactor)
initialCapacity
- the initial capacity of the hash map.loadFactor
- the load factor of the hash map.java.lang.IllegalArgumentException
- if the initial capacity is less
than zero, or if the load factor is nonpositive.protected AbstractHashSetOfFreezables(int initialCapacity)
initialCapacity
- the initial capacity of the hash table.java.lang.IllegalArgumentException
- if the initial capacity is less
than zero.protected AbstractHashSetOfFreezables(Identitor identitor)
protected AbstractHashSetOfFreezables(Identitor identitor, int initialCapacity, float loadFactor)
identitor
- initialCapacity
- the initial capacity of the hash map.loadFactor
- the load factor of the hash map.java.lang.IllegalArgumentException
- if the initial capacity is less
than zero, or if the load factor is nonpositive.protected AbstractHashSetOfFreezables(Identitor identitor, int initialCapacity)
identitor
- initialCapacity
- the initial capacity of the hash table.java.lang.IllegalArgumentException
- if the initial capacity is less
than zero.Method Detail |
protected boolean add(java.lang.Object o)
add
in class AbstractHashSet
o
- element to be added to this set.protected Freezer getFreezer()
protected Freezable getFreezableForID(java.io.Serializable id)
protected boolean addIdentifiedBy(java.io.Serializable id)
java.lang.UnsupportedOperationException
- add is not supported by this collection.java.lang.ClassCastException
- class of the specified element prevents it from being
added to this collection.java.lang.IllegalArgumentException
- some aspect of this element prevents it from being
added to this collection.ZombieIdentifierException
- if f is not in the Freezer and this implementation checks on add.protected boolean removeIdentifiedBy(java.io.Serializable id)
The AbstractHashSet implementation has to scan the freezables in the Set to find the right one.
java.lang.UnsupportedOperationException
- remove is not supported by this collection.protected boolean addAllIdentifiedBy(Collection c)
java.lang.UnsupportedOperationException
- if this collection does not support the addAll method.java.lang.ClassCastException
- if the class of an element of the specified collection prevents it from being
added to this collection.java.lang.IllegalArgumentException
- some aspect of an element of the specified collection prevents it from being
added to this collection.protected boolean removeAllIdentifiedBy(Collection c)
java.lang.ClassCastException
- if the class of an element of the specified collection prevents it from being
added to this collection.java.lang.IllegalArgumentException
- some aspect of an element of the specified collection prevents it from being
added to this collection.protected boolean retainAllIdentifiedBy(Collection c)
java.lang.ClassCastException
- if the class of an element of the specified collection prevents it from being
added to this collection.java.lang.IllegalArgumentException
- some aspect of an element of the specified collection prevents it from being
added to this collection.public boolean containsIdentifiedBy(java.io.Serializable id)
This implementation has to scan the Set.
containsIdentifiedBy
in interface CollectionOfFreezables
public boolean containsAllIdentifiedBy(Collection ids)
containsAllIdentifiedBy
in interface CollectionOfFreezables
public FreezableIterator freezableIterator()
freezableIterator
in interface CollectionOfFreezables
public java.util.Iterator identifierIterator()
identifierIterator
in interface CollectionOfFreezables
public Collection getIdentifiers()
getIdentifiers
in interface CollectionOfFreezables
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |