[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

Constuctor Index

O SequentialComposer(MetaObject[])
Creates a Composer that will sequentially delegate operations and messages to the

Methods

O composerForArrayWithPolicies(MetaObject[], boolean, boolean, boolean)
If may_propagate_itself is true, compare the given metaObjects array with the internal
O configure(Object, Object)
Invokes the corresponding method that takes an array of MetaObjects.
O getMetaObjects()
Invokes the corresponding method that takes an array of MetaObjects.
O getMetaObjectsArray()
Obtains the MetaObjects this Composer delegates to.
O handle(Message, Object)
Invokes the corresponding method that takes an array of MetaObjects.
O handle(Result, Object)
Invokes the corresponding method that takes an array of MetaObjects.
O handle(Operation, Object)
Invokes the corresponding method that takes an array of MetaObjects.
O initialize(OperationFactory, Object)
Invoke the corresponding method that takes an array of MetaObjects.
O newComposer(MetaObject[])
Creates a new SequentialComposer with the given array of metaObjects
O reconfigure(Object, MetaObject, MetaObject)
Invokes the corresponding method that takes an array of MetaObjects.
O release(Object)
Invoke the corresponding method that takes an array of MetaObjects.

Constructors

O 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.

Methods

O 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

O 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

O getMetaObjects

public Enumeration getMetaObjects();
Invokes the corresponding method that takes an array of MetaObjects.

Overrides:
getMetaObjects in class Composer
See also:
getMetaObjects

O 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

O 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

O 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

O 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

O 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

O release

public void release(Object object);
Invoke the corresponding method that takes an array of MetaObjects.

Overrides:
release in class MetaObject
See also:
release

O 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

O 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