com.threerings.expr
Class SimpleScope

java.lang.Object
  extended by com.threerings.expr.SimpleScope
All Implemented Interfaces:
Scope, ScopeUpdateListener
Direct Known Subclasses:
ActorSprite.Implementation, Animation, Animation.Implementation, AreaCursor.Implementation, AreaSprite.Implementation, Articulated.Node, BaseParticleSystem.Layer, Cursor, EffectSprite.Implementation, GlobalSprite.Implementation, Model.Implementation, PathCursor.Implementation, PathSprite.Implementation, PlaceableCursor.Implementation, PlaceableSprite.Implementation, RenderEffect.Target, Sounder, Sounder.Implementation, Sprite, Surface, TileCursor.Implementation, TileSprite.Implementation

public abstract class SimpleScope
extends Object
implements Scope, ScopeUpdateListener

A base class for objects providing simple scopes.


Field Summary
 
Fields inherited from interface com.threerings.expr.Scope
EPOCH, NOW
 
Constructor Summary
SimpleScope(Scope parentScope)
          Creates a new simple scope.
 
Method Summary
 void addListener(ScopeUpdateListener listener)
          Adds a listener for changes in scope.
 void dispose()
          Releases the resources associated with this 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.
 void scopeUpdated(ScopeEvent event)
          Called when the scope has been updated.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleScope

public SimpleScope(Scope parentScope)
Creates a new simple scope.

Method Detail

dispose

public void dispose()
Releases the resources associated with this scope.


getScopeName

public String getScopeName()
Description copied from interface: Scope
Returns the name of this scope for purposes of qualification. Can return null if qualified symbols cannot specifically address this scope.

Specified by:
getScopeName in interface Scope

getParentScope

public Scope getParentScope()
Description copied from interface: Scope
Returns a reference to the parent scope, or null if this is the top level.

Specified by:
getParentScope in interface Scope

get

public <T> T get(String name,
                 Class<T> clazz)
Description copied from interface: Scope
Looks up a symbol in this scope.

Specified by:
get in interface Scope
Returns:
the mapping for the requested symbol, or null if not found.

addListener

public void addListener(ScopeUpdateListener listener)
Description copied from interface: Scope
Adds a listener for changes in scope. The listener will be notified when symbols are added or removed and whenever the scope hierarchy changes.

Specified by:
addListener in interface Scope

removeListener

public void removeListener(ScopeUpdateListener listener)
Description copied from interface: Scope
Removes a listener for changes in scope.

Specified by:
removeListener in interface Scope

scopeUpdated

public void scopeUpdated(ScopeEvent event)
Description copied from interface: ScopeUpdateListener
Called when the scope has been updated.

Specified by:
scopeUpdated in interface ScopeUpdateListener


Copyright © 2011. All Rights Reserved.