com.iplanet.jato.model
Class MultipleModelAdapter

java.lang.Object
  |
  +--com.iplanet.jato.model.MultipleModelAdapter
All Implemented Interfaces:
Model

public class MultipleModelAdapter
extends java.lang.Object
implements Model

A simple model that gathers values from and distributes values to one or more target models. For example, this class can be used to set a value on multiple target models using one setValue() method call.

Version:
JATO/1.2.2 $Id: MultipleModelAdapter.java,v 1.7 2002/03/16 03:26:31 todd Exp $

Constructor Summary
MultipleModelAdapter()
          Default constructor
MultipleModelAdapter(java.util.Collection targets)
          Initialize the adapter with the provided collection of target models
MultipleModelAdapter(Model target1)
          Initialize the adapter with the provided target model
MultipleModelAdapter(Model[] targets)
          Initialize the adapter with the provided array of target models
MultipleModelAdapter(Model target1, Model target2)
          Initialize the adapter with the provided target models
MultipleModelAdapter(Model target1, Model target2, Model target3)
          Initialize the adapter with the provided target models
 
Method Summary
 void addTargetModel(Model model)
          Adds a model to the list of target models.
 void clearTargetModels()
          Clears the list of models that will be included in the distribution/ gathering of values
 java.lang.String getName()
          Returns the logical instance name of this model.
 java.util.List getTargetModelList()
          Returns the models that will be included in the distribution/gathering of values as a list
 Model[] getTargetModels()
          Returns the models that will be included in the distribution/gathering of values
 java.lang.Object getValue(java.lang.String name)
          Returns a named value from this model
 java.lang.Object[] getValues(java.lang.String name)
          Returns a named set of values from this model
 void removeTargetModel(Model model)
          Removes a model to the list of target models.
 void setName(java.lang.String value)
          Sets the logical name of this model
 void setValue(java.lang.String name, java.lang.Object value)
          Sets a named value in this model.
 void setValues(java.lang.String name, java.lang.Object[] values)
          Sets a named set of values in this model
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultipleModelAdapter

public MultipleModelAdapter()
Default constructor

MultipleModelAdapter

public MultipleModelAdapter(Model target1)
Initialize the adapter with the provided target model

MultipleModelAdapter

public MultipleModelAdapter(Model target1,
                            Model target2)
Initialize the adapter with the provided target models

MultipleModelAdapter

public MultipleModelAdapter(Model target1,
                            Model target2,
                            Model target3)
Initialize the adapter with the provided target models

MultipleModelAdapter

public MultipleModelAdapter(Model[] targets)
Initialize the adapter with the provided array of target models

MultipleModelAdapter

public MultipleModelAdapter(java.util.Collection targets)
Initialize the adapter with the provided collection of target models
Method Detail

getName

public java.lang.String getName()
Returns the logical instance name of this model. This name can be any arbitrary string. This name may only be useful at certain times; for example, the ModelManager may assign a name to a model based on user request.
Specified by:
getName in interface Model
Returns:
The opaque, arbitrary name of this model

setName

public void setName(java.lang.String value)
Sets the logical name of this model
Specified by:
setName in interface Model
Parameters:
name - The new name of this model

getValue

public java.lang.Object getValue(java.lang.String name)
Description copied from interface: Model
Returns a named value from this model
Specified by:
getValue in interface Model
Following copied from interface: com.iplanet.jato.model.Model
Parameters:
name - The name of the value to return
Returns:
The specified value. If the model has multiple values for the specified name, the first value is returned. If there is no value for the specified name, this method returns null.

setValue

public void setValue(java.lang.String name,
                     java.lang.Object value)
Description copied from interface: Model
Sets a named value in this model. This method overwrites any current value or values. If multiple values were present previously, they are all discarded.
Specified by:
setValue in interface Model
Following copied from interface: com.iplanet.jato.model.Model
Parameters:
name - The name of the value to set
value - The value to set in this model

getValues

public java.lang.Object[] getValues(java.lang.String name)
Description copied from interface: Model
Returns a named set of values from this model
Specified by:
getValues in interface Model
Following copied from interface: com.iplanet.jato.model.Model
Parameters:
name - The name of the value set to return
Returns:
The specified set of values. If there is no value for the specified name, this method returns an array of zero length.

setValues

public void setValues(java.lang.String name,
                      java.lang.Object[] values)
Description copied from interface: Model
Sets a named set of values in this model
Specified by:
setValues in interface Model
Following copied from interface: com.iplanet.jato.model.Model
Parameters:
name - The name of the value set to set in the model
values - The set of values to set in this model

addTargetModel

public void addTargetModel(Model model)
Adds a model to the list of target models. The model will be included in the distribution/gathering of values.

removeTargetModel

public void removeTargetModel(Model model)
Removes a model to the list of target models. The model will be included in the distribution/gathering of values.

getTargetModels

public Model[] getTargetModels()
Returns the models that will be included in the distribution/gathering of values

getTargetModelList

public java.util.List getTargetModelList()
Returns the models that will be included in the distribution/gathering of values as a list

clearTargetModels

public void clearTargetModels()
Clears the list of models that will be included in the distribution/ gathering of values