mvc
Class CompositeModel<T,S extends NamedModel<? extends T>>

java.lang.Object
  extended by mvc.CallbackExecutor
      extended by mvc.CompositeModel<T,S>
All Implemented Interfaces:
Named, CallbackRegistry, Model<T>, NamedModel<T>
Direct Known Subclasses:
NonLeafCascadedChooser

public class CompositeModel<T,S extends NamedModel<? extends T>>
extends CallbackExecutor
implements NamedModel<T>

A CompositeModel gets its value from its currently selected submodel.


Constructor Summary
CompositeModel(java.lang.String nm, Choice.Model<S> smm)
          new CompositeModel(nm, smm) returns a new CompositeModel named nm.
CompositeModel(java.lang.String nm, Choice<S> mc)
          new CompositeModel(nm, mc) returns a new CompositeModel named nm.
 
Method Summary
 java.lang.String getName()
          m.getName() returns the name of m.
 S getSelectedSubmodel()
          m.getSelectedModel() returns the current selected submodel of m.
 Choice.Model<S> getSubmodelModel()
          m.getSelectedModel() returns the current selected submodel of m.
 T getValue()
          m.getValue() returns the current value of m.
 
Methods inherited from class mvc.CallbackExecutor
addCallback, executeCallbacks, removeCallback
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface mvc.CallbackRegistry
addCallback, removeCallback
 

Constructor Detail

CompositeModel

public CompositeModel(java.lang.String nm,
                      Choice<S> mc)
new CompositeModel(nm, mc) returns a new CompositeModel named nm. It gets its value from its currently selected submodel. Its submodel model is constructed from the choices in mc.


CompositeModel

public CompositeModel(java.lang.String nm,
                      Choice.Model<S> smm)
new CompositeModel(nm, smm) returns a new CompositeModel named nm. It gets its value from its currently selected submodel. Its submodel model is smm.

Method Detail

getName

public java.lang.String getName()
m.getName() returns the name of m.

Specified by:
getName in interface Named
Returns:

getValue

public T getValue()
m.getValue() returns the current value of m.

Specified by:
getValue in interface Model<T>
Returns:

getSelectedSubmodel

public S getSelectedSubmodel()
m.getSelectedModel() returns the current selected submodel of m.

Returns:

getSubmodelModel

public Choice.Model<S> getSubmodelModel()
m.getSelectedModel() returns the current selected submodel of m.

Returns: