com.taursys.model
Class ObjectCollectionValueHolder

java.lang.Object
  extended bycom.taursys.model.AbstractCollectionValueHolder
      extended bycom.taursys.model.ObjectCollectionValueHolder
All Implemented Interfaces:
javax.swing.event.ChangeListener, java.util.Collection, CollectionValueHolder, java.util.EventListener, ValueHolder

public class ObjectCollectionValueHolder
extends AbstractCollectionValueHolder

This class is a ValueHolder which contains a Collection of Objects. All get/setPropertyValue methods return the whole Object. It provides access to a current object via an internal iterator. The next and reset methods control the position in the collection. The hasNext indicates whether there is another object in the collection (used before invoking next).

You must invoke the next() method before invoking any method which acts on the valueObject (getValueObject, getPropertyValue, setPropertyValue). The next() method will retrieve a ValueObject from the collection and hold it for access and modification.

This ValueHolder also support connection to a parentValueHolder to provide its Collection. This is used for hierarchical data representations (master/detail). To make use of this feature, set the parentValueHolder and the property name which holds the Collection in the parent via the parentPropertyName property. This object will then be notified of changes in the parent and will retrieve its new Collection.

Version:
2.0
Author:
Marty Phelan

Constructor Summary
ObjectCollectionValueHolder()
          Constructs an ObjectCollectionValueHolder.
ObjectCollectionValueHolder(java.util.Collection collection)
          Constructs a new ObjectCollectionValueHolder for the given collection.
ObjectCollectionValueHolder(java.lang.Object[] array)
          Constructs an ObjectCollectionValueHolder with the given array of Objects as its Collection.
 
Methods inherited from class com.taursys.model.AbstractCollectionValueHolder
add, addAll, addChangeListener, clear, contains, containsAll, getAlias, getCollection, getJavaDataType, getObject, getObjectValueHolder, getParentPropertyName, getParentValueHolder, getPropertyValue, getPropertyValues, hasNext, isEmpty, iterator, next, remove, removeAll, removeChangeListener, reset, retainAll, setAlias, setCollection, setObject, setParentPropertyName, setParentValueHolder, setPropertyValue, setPropertyValues, size, stateChanged, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.taursys.model.CollectionValueHolder
equals, hashCode
 

Constructor Detail

ObjectCollectionValueHolder

public ObjectCollectionValueHolder()
Constructs an ObjectCollectionValueHolder. An ObjectValueHolder is created to access the current item.


ObjectCollectionValueHolder

public ObjectCollectionValueHolder(java.lang.Object[] array)
Constructs an ObjectCollectionValueHolder with the given array of Objects as its Collection. The Objects in the given array are stored in an ArrayList.


ObjectCollectionValueHolder

public ObjectCollectionValueHolder(java.util.Collection collection)
Constructs a new ObjectCollectionValueHolder for the given collection.



Copyright © 2007 Martin T Phelan. All Rights Reserved.