|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.iqual.chaplin.prop.Var<T>
public class Var<T>
This class represents a variable which can be bound to three scopes: global, thread-local and local. The same instance can be bound to one or more scopes whereas the value is taken from the most local one. The most local scope is local, then thread-local and then global.
A value stored in the global scope is visible from all threads and all methods which have the visibility of
the Var object. One uses def method for setting a value to this scope.
A value stored in the thread-local scope is visible only to the thread from which the value was set. One
calls bind method for setting a value to the thread-local scope.
A value stored in the local local scope is visible only within the method invocation from which the value
was set. One calls method let for setting a value to the local scope.
| Nested Class Summary | |
|---|---|
static class |
Var.UndefinedValueException
|
| Constructor Summary | |
|---|---|
Var()
|
|
| Method Summary | |
|---|---|
void |
bind(T val)
Binds the value to the thread-local scope. |
void |
def(T val)
Binds the value to the global scope. |
T |
get()
Retrieves the value of this variable. |
void |
let(T val)
Binds the value to the local scope. |
void |
set(T val)
Alias for def. |
void |
unbind()
Unbinds any value from the thread-local scope. |
void |
undef()
Unbinds any value from the global scope. |
void |
unlet()
Unbinds any value from the local scope. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Var()
| Method Detail |
|---|
public T get()
get in interface Property<T>public void set(T val)
def.
set in interface Property<T>val - the valuepublic void def(T val)
val - public void undef()
public void bind(T val)
val - public void unbind()
public void unlet()
public void let(T val)
val -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||