com.taursys.model
Class VOCollectionValueHolder

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

public class VOCollectionValueHolder
extends AbstractCollectionValueHolder

ValueHolder which has a Collection of ValueObjects. 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.


Constructor Summary
VOCollectionValueHolder()
          Constructs a new VOCollectionValueHolder
VOCollectionValueHolder(java.util.Collection collection)
          Constructs a new VOCollectionValueHolder for the given collection.
VOCollectionValueHolder(int size)
          Constructs a new VOCollectionValueHolder with an empty given size ArrayList.
 
Method Summary
 java.lang.Object getValueObject()
          Deprecated. - use getObject() instead
 java.lang.Class getValueObjectClass()
          Get the class of the value object.
 void setValueObject(java.lang.Object obj)
          Deprecated. - use setObject instead
 void setValueObjectClass(java.lang.Class clazz)
          Sets the class of the value object.
 
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

VOCollectionValueHolder

public VOCollectionValueHolder()
Constructs a new VOCollectionValueHolder


VOCollectionValueHolder

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


VOCollectionValueHolder

public VOCollectionValueHolder(int size)
Constructs a new VOCollectionValueHolder with an empty given size ArrayList.

Method Detail

setValueObjectClass

public void setValueObjectClass(java.lang.Class clazz)
Sets the class of the value object. Only needed if the obj itself can be null. If set, this takes presidence over the actual class of the obj.


getValueObjectClass

public java.lang.Class getValueObjectClass()
Get the class of the value object. Only needed if the obj itself can be null. If set, this takes presidence over the actual class of the obj.

Returns:
the Class of the value object

getValueObject

public java.lang.Object getValueObject()
Deprecated. - use getObject() instead


setValueObject

public void setValueObject(java.lang.Object obj)
Deprecated. - use setObject instead



Copyright © 2007 Martin T Phelan. All Rights Reserved.