|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.googlecode.sarasvati.impl.NestedEnv
public class NestedEnv
Constructor Summary | |
---|---|
NestedEnv(Env outerEnv,
Env innerEnv)
|
Method Summary | ||
---|---|---|
String |
getAttribute(String name)
Gets an attribute as a String. |
|
|
getAttribute(String name,
Class<T> type)
Returns the given attribute, transformed into the given type. |
|
|
getAttribute(String name,
Class<T> type,
T defaultValue)
Returns the given attribute, transformed into the given type. |
|
Iterable<String> |
getAttributeNames()
Returns an Iterable of attribute names. |
|
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 |
hasAttribute(String name)
Checks if the given attribute is present. |
|
boolean |
hasTransientAttribute(String name)
Returns true if this transient attribute exists in the environment and false otherwise. |
|
void |
importEnv(Env env)
Imports the given env into the outer env |
|
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 class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NestedEnv(Env outerEnv, Env innerEnv)
Method Detail |
---|
public Iterable<String> getAttributeNames()
ReadEnv
getAttributeNames
in interface ReadEnv
public String getAttribute(String name)
ReadEnv
getAttribute
in interface ReadEnv
name
- The name of the attribute to get
public <T> T getAttribute(String name, Class<T> type)
ReadEnv
getAttribute
in interface ReadEnv
T
- The type which the attribute should be returned as.name
- The name of the attribute to get.type
- The class type which the attribute should be transformed to.
public <T> T getAttribute(String name, Class<T> type, T defaultValue)
ReadEnv
getAttribute
in interface ReadEnv
T
- The type which the attribute should be returned as.name
- The name of the attribute to get.type
- The class type which the attribute should be transformed to.defaultValue
- The value to return if no value is set.
public boolean hasAttribute(String name)
ReadEnv
hasAttribute
in interface ReadEnv
name
- Name of the attribute to check for
public void removeAttribute(String name)
Env
removeAttribute
in interface Env
name
- The name of the attribute to removepublic void setAttribute(String name, String value)
Env
setAttribute
in interface Env
name
- The name of the attribute to set.value
- The value to set the attribute topublic void setAttribute(String name, Object value)
Env
setAttribute
in interface Env
name
- The name of the attribute to set.value
- The value to set the attribute topublic void setTransientAttribute(String name, Object value)
Env
GraphProcess
or
NodeToken
instance is in memory. In other words, these
attributes will not be persisted to whatever the backing store
is.
setTransientAttribute
in interface Env
name
- The name of the attributevalue
- The value of the attributepublic boolean hasTransientAttribute(String name)
Env
hasTransientAttribute
in interface Env
name
- The transient attribute name
public Object getTransientAttribute(String name)
Env
getTransientAttribute
in interface Env
name
- The attribute name
public void removeTransientAttribute(String name)
Env
removeTransientAttribute
in interface Env
name
- The attribute namepublic Iterable<String> getTransientAttributeNames()
Env
Iterable
of transient attribute names.
getTransientAttributeNames
in interface Env
Iterable
of transient attribute namespublic void importEnv(Env env)
importEnv
in interface Env
env
- The environment to copy
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |