|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Scope
.
To represent the name space for storing variables.
There are two ways to declare variables: by zscirpt, or by
Component.setVariable(java.lang.String, java.lang.Object, boolean)
/
Page.setVariable(java.lang.String, java.lang.Object)
.
Each ID space (IdSpace
has an independent
name space to store varaibles.
It is a mimic concept of ID space to work with zscript.
public interface Namespace
Interpreter
Method Summary | |
---|---|
boolean |
addChangeListener(NamespaceChangeListener listener)
Deprecated. |
boolean |
containsVariable(java.lang.String name,
boolean local)
Deprecated. Returns whether the specified variable is defined. |
Component |
getOwner()
Deprecated. Returns the component that owns this namespace, or null if it is owned by a page, or not owned by any one. |
Page |
getOwnerPage()
Deprecated. Returns the page that owns this namespace, or null if not owned by any page. |
Namespace |
getParent()
Deprecated. Returns the parent name space, or null if this is topmost. |
java.lang.Object |
getVariable(java.lang.String name,
boolean local)
Deprecated. Returns the variable of the specified name, or null if not defined or the value is null. |
java.util.Set |
getVariableNames()
Deprecated. Returns a set of variable names stored in this name space. |
boolean |
removeChangeListener(NamespaceChangeListener listener)
Deprecated. |
void |
setParent(Namespace parent)
Deprecated. Sets the parent name space. |
void |
setVariable(java.lang.String name,
java.lang.Object value,
boolean local)
Deprecated. Sets the variable of the specified name. |
void |
unsetVariable(java.lang.String name,
boolean local)
Deprecated. Unsets a variable from the current ID space. |
Method Detail |
---|
Component getOwner()
Page getOwnerPage()
java.util.Set getVariableNames()
Note: it doesn't include the parent's varaibles.
boolean containsVariable(java.lang.String name, boolean local)
local
- whether not to search its ancestor.
If false and the current ID space doen't define the variable,
it searches up its ancestor (via getParent()
) to see
any of them has defined the specified variable.java.lang.Object getVariable(java.lang.String name, boolean local)
local
- whether not to search its ancestor.
If false and the current ID space doen't define the variable,
it searches up its ancestor (via getParent()
) to see
any of them has defined the specified variable.void setVariable(java.lang.String name, java.lang.Object value, boolean local)
local
- whether not to set the variable to this name space
directly. If false, it searches whether the variable is defined
in any of its ancestor (via getParent()
). If local = false
and the ancestor is found, the value is stored to the ancestor
instead of this.
UiException
- if failed.void unsetVariable(java.lang.String name, boolean local)
Unlike setVariable(java.lang.String, java.lang.Object, boolean)
, this method removed only
the variable defined in the ID space cotnaining this component.
Namespace getParent()
void setParent(Namespace parent)
boolean addChangeListener(NamespaceChangeListener listener)
boolean removeChangeListener(NamespaceChangeListener listener)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |