org.exolab.castor.mapping.loader.collection.handler
Class QueueCollectionHandler<T>

java.lang.Object
  extended by org.exolab.castor.mapping.loader.collection.handler.QueueCollectionHandler<T>
All Implemented Interfaces:
CollectionHandler<T>

public final class QueueCollectionHandler<T>
extends Object
implements CollectionHandler<T>


Constructor Summary
QueueCollectionHandler()
           
 
Method Summary
 Object add(Object collection, T object)
          Add an object to the collection.
 Object clear(Object collection)
          Clears the collection of any objects.
 Enumeration<T> 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.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QueueCollectionHandler

public QueueCollectionHandler()
Method Detail

add

public Object add(Object collection,
                  T object)
Description copied from interface: CollectionHandler
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).

Specified by:
add in interface CollectionHandler<T>
Parameters:
collection - The collection, null if no collection has been created yet
object - The object to add to the collection
Returns:
The collection with the new object if a different instance than the collection parameter, null otherwise

elements

public Enumeration<T> elements(Object collection)
Description copied from interface: CollectionHandler
Returns an enumeration of all the elements in the collection.

Specified by:
elements in interface CollectionHandler<T>
Parameters:
collection - The collection
Returns:
An enumeration of all the elements in the collection

size

public int size(Object collection)
Description copied from interface: CollectionHandler
Returns the number of elements in the collection.

Specified by:
size in interface CollectionHandler<T>
Parameters:
collection - The collection
Returns:
Number of elements in the collection

clear

public Object clear(Object collection)
Description copied from interface: CollectionHandler
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).

Specified by:
clear in interface CollectionHandler<T>
Parameters:
collection - The collection, null if no collection has been created yet
Returns:
The empty collection if a different instance than the collection parameter, null otherwise

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.