org.exolab.castor.mapping
Interface CollectionHandler
public interface CollectionHandler
Collection handler for adding/listing elements of a collection.
A collection field will use this handler to add elements when it's
value is set, and to enumerate then when it's value is retrieved.
A collection handler is instantiated only once, must be thread
safe and not use any synchronization.
$Revision: 1.1.1.1 $ $Date: 2003/03/03 07:08:26 $ Object | add(Object collection, Object object)- Add an object to the collection.
|
Object | clear(Object collection)- Clears the collection of any objects.
|
Enumeration | elements(Object collection)- Returns an enumeration of all the elements in the collection.
|
int | size(Object collection)- Returns the number of elements in the collection.
|
add
public Object add(Object collection,
Object object)
throws ClassCastException Add an object to the collection. A collection may not allow the
same object to be added more than once. The collection is provided
as a parameter and is returned as the return value if the returned
collection is a different object. That way the handler can create
a new collection or change the collection as necessary (e.g. when
resizing an array).
collection - The collection, null if no collection has
been created yetobject - The object to add to the collection
- The collection with the new object if a different
instance than the collection parameter, null otherwise
clear
public Object clear(Object collection)
throws ClassCastException Clears the collection of any objects. The collection is provided
as a parameter and is returned as the return value if the returned
collection is a different object. That way the handler can create
a new collection or change the collection as necessary (e.g. when
resizing an array).
collection - The collection, null if no collection has
been created yet
- The empty collection if a different
instance than the collection parameter, null otherwise
elements
public Enumeration elements(Object collection)
throws ClassCastException Returns an enumeration of all the elements in the collection.
collection - The collection
- An enumeration of all the elements in the collection
size
public int size(Object collection)
throws ClassCastException Returns the number of elements in the collection.
collection - The collection
- Number of elements in the collection
Intalio Inc. (C) 1999-2003. All rights reserved http://www.intalio.com