edu.rice.cs.plt.lambda
Class SimpleBox<T>

java.lang.Object
  extended by edu.rice.cs.plt.lambda.SimpleBox<T>
All Implemented Interfaces:
Box<T>, Thunk<T>, java.io.Serializable

public class SimpleBox<T>
extends java.lang.Object
implements Box<T>, java.io.Serializable

A box that freely supports reads and writes.

As a wrapper for arbitrary objects, instances of this class will serialize without error only if the wrapped object is serializable.

See Also:
Serialized Form

Constructor Summary
SimpleBox()
          Create a box initialized with null
SimpleBox(T val)
          Create a box initialized with val
 
Method Summary
static
<T> Box<T>
make()
          Call the constructor (allows T to be inferred)
static
<T> Box<T>
make(T val)
          Call the constructor (allows T to be inferred)
 void set(T val)
           
 T value()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleBox

public SimpleBox(T val)
Create a box initialized with val


SimpleBox

public SimpleBox()
Create a box initialized with null

Method Detail

set

public void set(T val)
Specified by:
set in interface Box<T>

value

public T value()
Specified by:
value in interface Thunk<T>

make

public static <T> Box<T> make(T val)
Call the constructor (allows T to be inferred)


make

public static <T> Box<T> make()
Call the constructor (allows T to be inferred)