org.globus.cog.gridshell.interfaces
Interface Scope

All Superinterfaces:
PropertyChangeNotifier, Serializable
All Known Implementing Classes:
ScopeImpl

public interface Scope
extends Serializable, PropertyChangeNotifier

Create a scope that variables can be stored in which may or may not have a super class


Nested Class Summary
static class Scope.Mode
          A class that designates the mode of this variable
 
Field Summary
static Scope.Mode READ_ONLY
          Sets the variable to read only mode, it can't be written to
static Scope.Mode READ_WRITE
          Sets the variable to read write mode, this is the default mode
 
Method Summary
 Scope.Mode getMode(String name)
          Returns the mode the variable is
 Scope getSuper()
          Returns a super class if one is defined, otherwise returns null
 Set getUniqueValues()
          Returns values (no duplicates)
 Object getValue(String name)
          Gets the value associated with variable name for this or superclass
 Collection getValues()
          Returns all the values (duplicates included)
 Set getVariableNames()
          Returns a collection of the variable names for this scope and any superclass
 void setMode(String name, Scope.Mode value)
          Sets the mode of a variable
 void setVariableTo(String name, Object value)
          If a variable "name" is defined in "this" sets the variable to value, next checks for the variable "name" up the superclass chain.
 boolean variableExists(String name)
          Returns true of the variable exists either in "this" or up the super chain
 
Methods inherited from interface org.globus.cog.gridshell.interfaces.PropertyChangeNotifier
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener
 

Field Detail

READ_ONLY

public static final Scope.Mode READ_ONLY
Sets the variable to read only mode, it can't be written to


READ_WRITE

public static final Scope.Mode READ_WRITE
Sets the variable to read write mode, this is the default mode

Method Detail

getVariableNames

public Set getVariableNames()
Returns a collection of the variable names for this scope and any superclass

Returns:

getValue

public Object getValue(String name)
Gets the value associated with variable name for this or superclass

Parameters:
name - - the name of the variable to look for
Returns:

getValues

public Collection getValues()
Returns all the values (duplicates included)

Returns:

getUniqueValues

public Set getUniqueValues()
Returns values (no duplicates)

Returns:

getSuper

public Scope getSuper()
Returns a super class if one is defined, otherwise returns null

Returns:

setVariableTo

public void setVariableTo(String name,
                          Object value)
                   throws ScopeException
If a variable "name" is defined in "this" sets the variable to value, next checks for the variable "name" up the superclass chain. If no such variable is found all the way up, creates a new variable this.name and sets to value

Parameters:
name - - the name of the variable
value - - the value to set the variable to
Throws:
ScopeException - - thrown if failed to set the variable

variableExists

public boolean variableExists(String name)
Returns true of the variable exists either in "this" or up the super chain

Parameters:
name -
Returns:

getMode

public Scope.Mode getMode(String name)
Returns the mode the variable is

Parameters:
name -
Returns:

setMode

public void setMode(String name,
                    Scope.Mode value)
Sets the mode of a variable

Parameters:
name -
value -