[all packages]
[package BR.unicamp.Guarana]
[class hierarchy]
[index]
public class BR.unicamp.Guarana.SequentialComposer
(source file: /home/lsd/oliva/src/java/guarana/kaffe/libraries/extensions/guarana/javalib/BR/unicamp/Guarana/SequentialComposer.java)
java.lang.Object
|
+----BR.unicamp.Guarana.MetaObject
|
+----BR.unicamp.Guarana.Composer
|
+----BR.unicamp.Guarana.SequentialComposerAlgorithms.WithArrayAndRange
|
+----BR.unicamp.Guarana.SequentialComposerAlgorithms.WithArray
|
+----BR.unicamp.Guarana.SequentialComposer
The pure class interface.
public class SequentialComposer
extends WithArray
- Implements a Composer that sequentially requests a fixed set of
MetaObjects to handle Operations, Results and Messages, as well as
reconfiguration, configuration, initialize and release requests.
It assumes the array of metaObjects is constant. Reconfiguration
is only accomplished with the creation of a new composer.
The most important adaptation point for subclasses is the
method newComposer; if it is not overridden, configure and
reconfigure requests may cause the creation of SequentialComposers
instead of instances of the subclass, whenever a configuration or
reconfiguration results in a different array of MetaObjects.
Furthermore, if configure or reconfigure result a unitary or empty
array of MetaObjects, SequentialComposers will leave, being
replaced with null or with the only MetaObject in the array.
These policies can be changed by overriding composerForArray, that
affects both configure and reconfigure, or composerForConfigure
and/or composerForReconfigure.
- See also:
- newComposer, composerForArrayWithPolicies, composerForArray, composerForConfigure, composerForReconfigure
- SequentialComposer(MetaObject[])
- Creates a Composer that will sequentially delegate operations
and messages to the
- composerForArrayWithPolicies(MetaObject[], boolean, boolean, boolean)
- If may_propagate_itself is true, compare the given metaObjects
array with the internal
- configure(Object, Object)
- Invokes the corresponding method that takes an array of
MetaObjects.
- getMetaObjects()
- Invokes the corresponding method that takes an array of
MetaObjects.
- getMetaObjectsArray()
- Obtains the MetaObjects this Composer delegates to.
- handle(Message, Object)
- Invokes the corresponding method that takes an array of
MetaObjects.
- handle(Result, Object)
- Invokes the corresponding method that takes an array of
MetaObjects.
- handle(Operation, Object)
- Invokes the corresponding method that takes an array of
MetaObjects.
- initialize(OperationFactory, Object)
- Invoke the corresponding method that takes an array of
MetaObjects.
- newComposer(MetaObject[])
- Creates a new SequentialComposer with the given array of
metaObjects
- reconfigure(Object, MetaObject, MetaObject)
- Invokes the corresponding method that takes an array of
MetaObjects.
- release(Object)
- Invoke the corresponding method that takes an array of
MetaObjects.
SequentialComposer
public SequentialComposer(MetaObject[] metaObjects);
- Creates a Composer that will sequentially delegate operations
and messages to the elements of metaObjects. The array is
cloned, so as to ensure that it is never changed.
- Parameters:
- metaObjects - the set of MetaObjects the Composer should
delegate to.
getMetaObjectsArray
public MetaObject[] getMetaObjectsArray();
- Obtains the MetaObjects this Composer delegates to.
- Returns:
- a clone of the internal array of MetaObjects.
- Overrides:
- getMetaObjectsArray in class Composer
handle
public Result handle(Operation operation,
Object object);
- Invokes the corresponding method that takes an array of
MetaObjects.
- Overrides:
- handle in class MetaObject
- See also:
- handleOperation
getMetaObjects
public Enumeration getMetaObjects();
- Invokes the corresponding method that takes an array of
MetaObjects.
- Overrides:
- getMetaObjects in class Composer
- See also:
- getMetaObjects
handle
public Result handle(Result result,
Object object);
- Invokes the corresponding method that takes an array of
MetaObjects.
- Overrides:
- handle in class MetaObject
- See also:
- handleResult
handle
public void handle(Message message,
Object object);
- Invokes the corresponding method that takes an array of
MetaObjects.
- Overrides:
- handle in class MetaObject
- See also:
- handleMessage
configure
public MetaObject configure(Object newObject,
Object object);
- Invokes the corresponding method that takes an array of
MetaObjects.
- Overrides:
- configure in class MetaObject
- See also:
- configure
reconfigure
public synchronized MetaObject reconfigure(Object object,
MetaObject oldMetaObject,
MetaObject newMetaObject);
- Invokes the corresponding method that takes an array of
MetaObjects.
- Overrides:
- reconfigure in class MetaObject
- See also:
- reconfigure
initialize
public void initialize(OperationFactory factory,
Object object);
- Invoke the corresponding method that takes an array of
MetaObjects.
- Overrides:
- initialize in class MetaObject
- See also:
- initialize
release
public void release(Object object);
- Invoke the corresponding method that takes an array of
MetaObjects.
- Overrides:
- release in class MetaObject
- See also:
- release
composerForArrayWithPolicies
protected MetaObject composerForArrayWithPolicies(MetaObject[] metaObjects,
boolean may_propagate_itself,
boolean may_leave_when_empty,
boolean may_leave_when_unitary);
- If may_propagate_itself is true, compare the given metaObjects
array with the internal array. If they're the same array,
return itself. Otherwise, delegate the invocation to the
superclass.
- Overrides:
- composerForArrayWithPolicies in class WithArray
- See also:
- composerForArrayWithPolicies
newComposer
protected MetaObject newComposer(MetaObject[] metaObjects);
- Creates a new SequentialComposer with the given array of
metaObjects. It may be indirectly called from configure and
reconfigure, when a new composer must be created. A subclass
should override this method to create an instance of the
subclass.
- Parameters:
- metaObjects - the set of MetaObjects the new Composer
should delegate to.
- Returns:
- the new Composer.
- Overrides:
- newComposer in class WithArray
[all packages]
[package BR.unicamp.Guarana]
[class hierarchy]
[index]
BR.unicamp.Guarana.SequentialComposer.html