com.threerings.expr
Interface Scope

All Known Implementing Classes:
ActorSprite, ActorSprite.Acting, ActorSprite.Implementation, ActorSprite.Moving, ActorSprite.Original, ActorSprite.StatefulEntry, Animation, Animation.Implementation, Animation.Imported, Animation.Procedural, Animation.Sequential, AreaCursor, AreaCursor.Implementation, AreaCursor.Original, AreaSprite, AreaSprite.Implementation, AreaSprite.Original, Articulated, Articulated.MeshNode, Articulated.Node, BaseParticleSystem, BaseParticleSystem.Layer, ComponentBillboard, Compound, Conditional, Cursor, DynamicScope, EffectSprite, EffectSprite.Animator, EffectSprite.Implementation, EffectSprite.Original, EntryCursor, EntrySprite, GlApp, GlCanvasApp, GlCanvasTool, GlDisplayApp, GlobalSprite, GlobalSprite.Camera, GlobalSprite.EnvironmentModel, GlobalSprite.Implementation, HashScene, InterfaceTester, MetaParticleSystem, MetaParticleSystem.Layer, Model, Model.Implementation, ModelTool, ModelViewer, ParticleEditor, ParticleSystem, ParticleSystem.Layer, PathCursor, PathCursor.Implementation, PathCursor.Original, PathSprite, PathSprite.Implementation, PathSprite.Original, PlaceableCursor, PlaceableCursor.Implementation, PlaceableCursor.Original, PlaceableSprite, PlaceableSprite.ClickableProp, PlaceableSprite.Implementation, PlaceableSprite.Marker, PlaceableSprite.Original, PlaceableSprite.Prop, RenderEffect, RenderEffect.OutputTarget, RenderEffect.Target, RenderEffect.TextureTarget, Scene, Scene.Transient, SceneEditor, SceneInfluencer, Scripted, SelectionCursor, ShapeModel, SimpleScene, SimpleScope, Sounder, Sounder.BaseClip, Sounder.BaseStream, Sounder.Clip, Sounder.Compound, Sounder.Conditional, Sounder.Implementation, Sounder.MetaClip, Sounder.MetaStream, Sounder.Random, Sounder.Scripted, Sounder.Sequential, Sounder.Stream, Sounder.VariableClip, Sprite, Static, Surface, TileCursor, TileCursor.Implementation, TileCursor.Original, TileSprite, TileSprite.Implementation, TileSprite.Original, ToolSceneView, TudeySceneView, TudeyTool, ViewerAffecter, Wrapper

public interface Scope

Provides a means to resolve symbols in a dynamic, hierarchical fashion. Symbols can be mapped to Functions, Variables, or arbitrary objects (often mutable ones, so that values can change after resolution).


Field Summary
static String EPOCH
          The name of a special symbol that we expect to map to a MutableLong containing the base time of the scope's owner (such at the time at which an animation started).
static String NOW
          The name of a special symbol that we expect to map to a MutableLong containing the current time as sampled at the beginning of each frame.
 
Method Summary
 void addListener(ScopeUpdateListener listener)
          Adds a listener for changes in scope.
<T> T
get(String name, Class<T> clazz)
          Looks up a symbol in this scope.
 Scope getParentScope()
          Returns a reference to the parent scope, or null if this is the top level.
 String getScopeName()
          Returns the name of this scope for purposes of qualification.
 void removeListener(ScopeUpdateListener listener)
          Removes a listener for changes in scope.
 

Field Detail

NOW

static final String NOW
The name of a special symbol that we expect to map to a MutableLong containing the current time as sampled at the beginning of each frame.

See Also:
Constant Field Values

EPOCH

static final String EPOCH
The name of a special symbol that we expect to map to a MutableLong containing the base time of the scope's owner (such at the time at which an animation started).

See Also:
Constant Field Values
Method Detail

getScopeName

String getScopeName()
Returns the name of this scope for purposes of qualification. Can return null if qualified symbols cannot specifically address this scope.


getParentScope

Scope getParentScope()
Returns a reference to the parent scope, or null if this is the top level.


get

<T> T get(String name,
          Class<T> clazz)
Looks up a symbol in this scope.

Returns:
the mapping for the requested symbol, or null if not found.

addListener

void addListener(ScopeUpdateListener listener)
Adds a listener for changes in scope. The listener will be notified when symbols are added or removed and whenever the scope hierarchy changes.


removeListener

void removeListener(ScopeUpdateListener listener)
Removes a listener for changes in scope.



Copyright © 2011. All Rights Reserved.