sky.monome.behavior.factory
Class GenericBehaviorFactory


java.lang.Object

  extended by sky.monome.behavior.factory.GenericBehaviorFactory

All Implemented Interfaces:
BehaviorFactory

public class GenericBehaviorFactory
extends java.lang.Object
implements BehaviorFactory

Generic behavior factory which can produce serially behaviors of the class specified at construction.

Since:
SkyMonome v1.1
Author:
PJ Skyman

Constructor Summary
GenericBehaviorFactory(java.lang.Class<? extends Behavior> behaviorClass, java.lang.Object... argumentsForBehavior)
          Constructs a generic behavior factory which can produce behaviors of the specified class and with the specified arguments common to all produced behaviors.
 
Method Summary
 Behavior createBehavior(java.lang.Object... arguments)
          Creates a behavior with the help of optional arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericBehaviorFactory


public GenericBehaviorFactory(java.lang.Class<? extends Behavior> behaviorClass,

                              java.lang.Object... argumentsForBehavior)

                       throws MonomeException
Constructs a generic behavior factory which can produce behaviors of the specified class and with the specified arguments common to all produced behaviors.

Parameters:
behaviorClass - Class object that denotes the type of behaviors that will be produced by this factory.
argumentsForBehavior - Optional arguments that can be used for the behaviors factoring. These arguments must be specified in a good order so that a constructor is defined for the specified behavior class with specified arguments.
Throws:
MonomeException - When no constructor is found for the specified class and specified arguments in the same order.
Method Detail

createBehavior


public Behavior createBehavior(java.lang.Object... arguments)

                        throws MonomeException
Creates a behavior with the help of optional arguments.

Specified by:
createBehavior in interface BehaviorFactory
Parameters:
arguments - Optional arguments that can help the behavior factoring. Note that this kind of factory does not use these arguments.
Returns:
A behavior freshly created.
Throws:
MonomeException - When the behavior factoring can't operate successfully.