MetaDone
metadone.client.grasyla2.GrasylaContext Class Reference
Inheritance diagram for metadone.client.grasyla2.GrasylaContext:
Collaboration diagram for metadone.client.grasyla2.GrasylaContext:

List of all members.

Public Member Functions

 GrasylaContext (GrasylaContext parent)
 GrasylaContext (ConcreteObjectGroup cog, GrasylaContext parent)
GrasylaEquation getEquation ()
final ConcreteObjectGroup getObject ()
boolean setObject (ConcreteObjectGroup cog, boolean ordered)
final GrasylaContext getParentContext ()
String getFunctor ()
void setFunctor (String functor)
Object getVariable (String name)
boolean setVariable (String name, Object value)
VariableContext getVariableContext (String name)
EventTower< Object > getVariableEvents ()
EventTower< Object > getContextEvents ()
ScriptEvaluator getScriptEvaluator (ProgLanguage lang)
Set< ScriptEvaluatorgetScriptEvaluators ()
final void initScriptEvaluator (ScriptEvaluator eval)
GrasylaEngineFactory getFactory ()
Workspace getWorkspace ()
GrasylaScript getScript ()
final View getView ()
final GrasylaEngine getOwner ()
void setOwner (GrasylaEngine engine, boolean createView) throws BadPreCondition
MetaModel getMetaModel ()
ConcreteModel getModel ()
SelectorBestEquation getSelector ()
Object configure () throws BadPreCondition
void activate ()
void deactivate ()

Protected Member Functions

String getFunctorFromParent ()
boolean declareVariable (String name, Object value, VariableStoreType type)
void initScriptEvaluatorGlobal (ScriptEvaluator eval)
final boolean ownsView ()
void setView (View view)

Static Protected Attributes

static final Logger logger = Logger.getLogger(GrasylaContext.class)

Private Member Functions

ConcreteObject getObjectSingle ()

Static Private Member Functions

static Object getPhenomenonValue (Phenomenon ph, String name) throws BadPreCondition
static void setPhenomenonValue (Phenomenon ph, String name, Object value) throws BadPreCondition
static Set< ConcreteObjectconvertToPhenomenonConcreteObjects (Object value)

Private Attributes

final GrasylaContext parent
final HashMap< String, Object > variables = new HashMap<String, Object>()
final EventTower< Object > event = new EventTowerNormal<Object>()
String functor
ConcreteObjectGroup cog
View view
GrasylaEngine owner
transient Subscriber
< EventValueChange
valueChanged = null

Static Private Attributes

static final Object STORED = new Object()
static final Object STORED_GLOBAL = new Object()
static final String CONTEXT_VAR = "GrasylaContextVar:"

Detailed Description

Grasyla context.

Author:
kma

Constructor & Destructor Documentation

metadone.client.grasyla2.GrasylaContext.GrasylaContext ( GrasylaContext  parent)

Initializes this context.

Parameters:
parentThe parent context

References metadone.client.grasyla2.GrasylaContext.getObject(), and metadone.client.grasyla2.GrasylaContext.parent.

metadone.client.grasyla2.GrasylaContext.GrasylaContext ( ConcreteObjectGroup  cog,
GrasylaContext  parent 
)

Initializes this context

Parameters:
cogThe concrete object group
parentThe parent context or null

References metadone.client.grasyla2.GrasylaContext.cog, and metadone.client.grasyla2.GrasylaContext.parent.


Member Function Documentation

Object metadone.client.grasyla2.GrasylaContext.configure ( ) throws BadPreCondition

Configure the object once all the dependencies have been solved by the Configuration object

Returns:
Some object that is dependent on the application. Should be used only to improve the diagnostic of problems only.
Exceptions:
BadPreCondition

Implements metadone.configuration.ConfigElement.

Reimplemented in metadone.client.grasyla2.GrasylaRootContext.

References metadone.client.grasyla2.GrasylaContext.getEquation(), metadone.client.grasyla2.GrasylaContext.getMetaModel(), and metadone.client.grasyla2.GrasylaContext.getModel().

Referenced by metadone.client.grasyla2.GrasylaInterpreter.configure(), and metadone.client.grasyla2.GrasylaEngine.updateContext().

static Set<ConcreteObject> metadone.client.grasyla2.GrasylaContext.convertToPhenomenonConcreteObjects ( Object  value) [static, private]
EventTower<Object> metadone.client.grasyla2.GrasylaContext.getContextEvents ( )

Gets the event tower for this context events.

Returns:
The event tower of the context

References metadone.client.grasyla2.GrasylaContext.event.

Referenced by metadone.client.grasyla2.GrasylaContext.getVariableEvents().

String metadone.client.grasyla2.GrasylaContext.getFunctorFromParent ( ) [protected]
final GrasylaEngine metadone.client.grasyla2.GrasylaContext.getOwner ( )
static Object metadone.client.grasyla2.GrasylaContext.getPhenomenonValue ( Phenomenon  ph,
String  name 
) throws BadPreCondition [static, private]
ScriptEvaluator metadone.client.grasyla2.GrasylaContext.getScriptEvaluator ( ProgLanguage  lang)

Gets the script evaluator for some language.

Parameters:
langThe language
Returns:
The script evaluator
Exceptions:
NoSuchElementExceptionwhen there is no script evaluator for that language

Implements metadone.client.display.Context.

Reimplemented in metadone.client.grasyla2.GrasylaRootContext.

References metadone.client.grasyla2.GrasylaContext.getParentContext(), metadone.client.grasyla2.GrasylaContext.getScriptEvaluator(), and metadone.client.grasyla2.GrasylaContext.parent.

Referenced by metadone.client.grasyla2.GrasylaContext.getScriptEvaluator().

Set<ScriptEvaluator> metadone.client.grasyla2.GrasylaContext.getScriptEvaluators ( )
VariableContext metadone.client.grasyla2.GrasylaContext.getVariableContext ( String  name)

Gets the variable context where the variable is defined.

The context is this it the variable is defined in this context, otherwise the call may be delegated or null can be returned.

Parameters:
nameThe name of the variable
Returns:
The context in which the variable is defined or null

Implements metadone.metabusiness.script.VariableContext.

Reimplemented in metadone.client.grasyla2.actions.GrasylaActionEngine.ActionContext.

References metadone.client.grasyla2.GrasylaContext.getParentContext(), metadone.client.grasyla2.GrasylaContext.getVariableContext(), metadone.client.grasyla2.GrasylaContext.parent, and metadone.client.grasyla2.GrasylaContext.variables.

Referenced by metadone.client.grasyla2.GrasylaContext.getVariableContext().

EventTower<Object> metadone.client.grasyla2.GrasylaContext.getVariableEvents ( )

Gets the event manager for variables.

Returns:
The event manager
See also:
VarChange

Implements metadone.metabusiness.script.VariableContext.

References metadone.client.grasyla2.GrasylaContext.getContextEvents().

final boolean metadone.client.grasyla2.GrasylaContext.ownsView ( ) [protected]

Checks whether this context is owned by an engine.

Returns:
true iff a view is set

References metadone.client.grasyla2.GrasylaContext.view.

Referenced by metadone.client.grasyla2.GrasylaContext.declareVariable(), and metadone.client.grasyla2.GrasylaContext.setOwner().

void metadone.client.grasyla2.GrasylaContext.setFunctor ( String  functor)

Sets the functor.

Parameters:
functorThe new functor

Reimplemented in metadone.client.grasyla2.GrasylaRootContext.

References metadone.client.grasyla2.GrasylaContext.functor.

Referenced by metadone.client.grasyla2.GrasylaEngine.updateContext().

boolean metadone.client.grasyla2.GrasylaContext.setObject ( ConcreteObjectGroup  cog,
boolean  ordered 
)

Tries to set the object for this context.

Parameters:
cogThe new concrete object group
orderedWhether the order of the elements matter
Returns:
true iff this new cog was set
See also:
ConcreteObjectGroupChange

References metadone.client.grasyla2.GrasylaContext.cog, metadone.client.display.ConcreteObjectGroup.getMultiplicity(), metadone.client.grasyla2.GrasylaContext.getObject(), and metadone.client.grasyla2.actions.ConcreteObjectGroupChange.isAccepted().

static void metadone.client.grasyla2.GrasylaContext.setPhenomenonValue ( Phenomenon  ph,
String  name,
Object  value 
) throws BadPreCondition [static, private]
void metadone.client.grasyla2.GrasylaContext.setView ( View  view) [protected]

Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations