com.googlecode.sarasvati.env
Interface Env

All Superinterfaces:
ReadEnv
All Known Implementing Classes:
MapEnv, NestedEnv, TokenSetMemberEnvAdapter

public interface Env
extends ReadEnv

Env extends ReadEnv to allow add/changed/removing attributes. It also allows getting/setting transient attributes.

Author:
Paul Lorenz

Method Summary
 Object getTransientAttribute(String name)
          Returns the value associated with the given named transient attribute.
 Iterable<String> getTransientAttributeNames()
          Returns an Iterable of transient attribute names.
 boolean hasTransientAttribute(String name)
          Returns true if this transient attribute exists in the environment and false otherwise.
 void importEnv(Env env)
          Copy all attributes from given env, including transient attributes.
 void removeAttribute(String name)
          Unsets any attribute with the given name.
 void removeTransientAttribute(String name)
          Remove the given attribute from the environment.
 void setAttribute(String name, Object value)
          Sets the attribute of the given name to the given value.
 void setAttribute(String name, String value)
          Sets the attribute of the given name to the given string value.
 void setTransientAttribute(String name, Object value)
          Set a transient attribute of the environment.
 
Methods inherited from interface com.googlecode.sarasvati.env.ReadEnv
getAttribute, getAttribute, getAttribute, getAttributeNames, hasAttribute
 

Method Detail

setAttribute

void setAttribute(String name,
                  String value)
Sets the attribute of the given name to the given string value.

Parameters:
name - The name of the attribute to set.
value - The value to set the attribute to

setAttribute

void setAttribute(String name,
                  Object value)
Sets the attribute of the given name to the given value.

Parameters:
name - The name of the attribute to set.
value - The value to set the attribute to

removeAttribute

void removeAttribute(String name)
Unsets any attribute with the given name.

Parameters:
name - The name of the attribute to remove

setTransientAttribute

void setTransientAttribute(String name,
                           Object value)
Set a transient attribute of the environment. The attribute will only be in the environment as long as the associated GraphProcess or NodeToken instance is in memory. In other words, these attributes will not be persisted to whatever the backing store is.
If a transient value already existed for the given name, the value will be overwritten
In the case of a memory back implementation, these transient attributes will have the same lifetime as other attributes.

Parameters:
name - The name of the attribute
value - The value of the attribute

hasTransientAttribute

boolean hasTransientAttribute(String name)
Returns true if this transient attribute exists in the environment and false otherwise.

Parameters:
name - The transient attribute name
Returns:
True if the given transient attribute exists in this environment

getTransientAttribute

Object getTransientAttribute(String name)
Returns the value associated with the given named transient attribute.

Parameters:
name - The attribute name
Returns:
The attribute value, or null if a value has not been set.

removeTransientAttribute

void removeTransientAttribute(String name)
Remove the given attribute from the environment.

Parameters:
name - The attribute name

getTransientAttributeNames

Iterable<String> getTransientAttributeNames()
Returns an Iterable of transient attribute names.

Returns:
Iterable of transient attribute names

importEnv

void importEnv(Env env)
Copy all attributes from given env, including transient attributes.

Parameters:
env - The environment to copy