com.objectwave.persist.collectionAdapters
Class HashMapCollectionAdapter

java.lang.Object
  |
  +--com.objectwave.persist.collectionAdapters.HashMapCollectionAdapter
All Implemented Interfaces:
CollectionAdapter, java.io.Serializable

public class HashMapCollectionAdapter
extends java.lang.Object
implements CollectionAdapter

Collection Adapters were introduced to support multiple collection types within the JavaGrinder Framework.

Version:
1.0
See Also:
Serialized Form

Constructor Summary
HashMapCollectionAdapter()
           
 
Method Summary
 void addElement(java.lang.Object obj)
          Add the object to this collection.
 java.lang.Object firstElement()
           
 java.lang.Object getCollectionObject()
          Get the actual collection object.
 CollectionAdapter getNewInstance()
          Invoked when a new instance is needed.
 void preQuery(SQLQuery q)
          An entry point to tweak the query before issuing the find.
 int size()
          The number of elements in the collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HashMapCollectionAdapter

public HashMapCollectionAdapter()
Method Detail

firstElement

public java.lang.Object firstElement()
Specified by:
firstElement in interface CollectionAdapter
Returns:

preQuery

public void preQuery(SQLQuery q)
An entry point to tweak the query before issuing the find. This will be a noop for most CollectionAdapters.

Specified by:
preQuery in interface CollectionAdapter
Parameters:
q -

getCollectionObject

public java.lang.Object getCollectionObject()
Get the actual collection object.

Specified by:
getCollectionObject in interface CollectionAdapter
Returns:
java.util.Vector

addElement

public void addElement(java.lang.Object obj)
Add the object to this collection. Override this method if you define your own collection adapter.

Specified by:
addElement in interface CollectionAdapter
Parameters:
obj - The feature to be added to the Element attribute

size

public int size()
The number of elements in the collection.

Specified by:
size in interface CollectionAdapter
Returns:

getNewInstance

public CollectionAdapter getNewInstance()
Description copied from interface: CollectionAdapter
Invoked when a new instance is needed. This could simply return 'this'. This is called when creating the SQLQuery that will realize a collection attribute. Normally, this method is not invoked, only when a CollectionAdapter is associated with an AttributeTypeColumn.

Specified by:
getNewInstance in interface CollectionAdapter
Returns:
The NewInstance value