Class ArrayCollectionHandler<T>
java.lang.Object
org.exolab.castor.mapping.loader.collection.handler.ArrayCollectionHandler<T>
- All Implemented Interfaces:
CollectionHandler<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd an object to the collection.Clears the collection of any objects.Returns an enumeration of all the elements in the collection.int
Returns the number of elements in the collection.toString()
-
Constructor Details
-
ArrayCollectionHandler
public ArrayCollectionHandler()
-
-
Method Details
-
add
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 interfaceCollectionHandler<T>
- Parameters:
collection
- The collection, null if no collection has been created yetobject
- 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
Description copied from interface:CollectionHandler
Returns an enumeration of all the elements in the collection.- Specified by:
elements
in interfaceCollectionHandler<T>
- Parameters:
collection
- The collection- Returns:
- An enumeration of all the elements in the collection
-
size
Description copied from interface:CollectionHandler
Returns the number of elements in the collection.- Specified by:
size
in interfaceCollectionHandler<T>
- Parameters:
collection
- The collection- Returns:
- Number of elements in the collection
-
clear
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 interfaceCollectionHandler<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
-