ref_send API 1.16
defensive programming in Java

org.ref_send.var
Class Variable<T>

java.lang.Object
  extended by org.joe_e.Struct
      extended by org.ref_send.var.Variable<T>
Type Parameters:
T - value type
All Implemented Interfaces:
java.io.Serializable, Selfless, Record

public class Variable<T>
extends Struct
implements Record, java.io.Serializable

A variable.

See Also:
Serialized Form

Field Summary
 Getter<T> getter
          read permission
 Guard<T> guard
          assignment condition
 Setter<T> setter
          write permission
 
Constructor Summary
Variable(Getter<T> getter, Setter<T> setter, Guard<T> guard)
          Constructs an instance.
 
Method Summary
 T get()
          Gets the near value.
 void set(T value)
          Sets the value.
static
<T> Variable<T>
var(T value)
          Constructs an instance.
static
<T> Variable<T>
var(T value, Guard<T> guard)
          Constructs an instance.
 
Methods inherited from class org.joe_e.Struct
equals, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

getter

public final Getter<T> getter
read permission


setter

public final Setter<T> setter
write permission


guard

public final Guard<T> guard
assignment condition

Constructor Detail

Variable

public Variable(Getter<T> getter,
                Setter<T> setter,
                Guard<T> guard)
Constructs an instance.

Parameters:
getter - getter
setter - setter
guard - guard
Method Detail

get

public final T get()
Gets the near value.


set

public final void set(T value)
Sets the value.

Parameters:
value - value to assign

var

public static <T> Variable<T> var(T value)
Constructs an instance.

Type Parameters:
T - value type
Parameters:
value - initial value

var

public static <T> Variable<T> var(T value,
                                  Guard<T> guard)
Constructs an instance.

Type Parameters:
T - value type
Parameters:
value - initial value
guard - assignment condition

ref_send API 1.16
defensive programming in Java

Submit a bug or feature, or get help

Copyright 1998-2007 Waterken Inc. under the terms of the MIT X license.