net.walend.lyophil.collection
Interface CollectionOfFreezables

All Superinterfaces:
Collection, HasState
All Known Subinterfaces:
FreezableSet, MutableCollectionOfFreezables, MutableSetOfFreezables, SetOfFreezables
All Known Implementing Classes:
AbstractFreezerHashSet, AbstractHashSetOfFreezables, DelegatingMutableSet, FreezableDelegatingMutableSet, JDBCBackedMutableSet, MemSet, MutableFreezerHashSet, MutableHashSetOfFreezables

public interface CollectionOfFreezables
extends Collection

This interface supplements the net.walend.collection.Collection interface. Use it for immutable Collections of Freezables.

Use a direct implementation of this interface, like Bag, to handle an immutable multiset.

All implementations of lyophil.collection.CollectionOfFreezables should include a constructor with the single argument Collection (or a sub interface) which creates a copy of the argument.

lyophil.collection.CollectionOfFreezables implementations should not mess with the normal java equals() and hashCode() methods. Doing so prevents creating a Map of dynamic Sets, critical for an in-memory Freezer.

Implementations of these interfaces should generally go back to the Freezer for Freezables.

Since:
20010105
Author:
David Walend

Method Summary
 boolean containsAllIdentifiedBy(Collection collectionOfIdentifiers)
          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.
 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.
 
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
 

Method Detail

containsIdentifiedBy

public boolean containsIdentifiedBy(java.io.Serializable id)
Returns true if this collection contains the specified Freezable. This method uses Serializable's equals() method.


containsAllIdentifiedBy

public boolean containsAllIdentifiedBy(Collection collectionOfIdentifiers)
Returns true if this collection contains the specified Freezables. This method uses Serializable's equals() method.


freezableIterator

public FreezableIterator freezableIterator()
Returns an iterator over the Freezables in this collection.


identifierIterator

public java.util.Iterator identifierIterator()
Returns an iterator over the identifiers in this collection.


getIdentifiers

public Collection getIdentifiers()
Returns a Collection of all the identifiers in this collection.



Copyright (c) 2000, 2001, David Walend