org.erights.e.elib.slot
Class SettableSlot

java.lang.Object
  |
  +--org.erights.e.elib.slot.SettableSlot
All Implemented Interfaces:
Slot

public class SettableSlot
extends Object
implements Slot

Untamed: A mutable Slot that remembers a current value, and remembers a ValueGuard for coercing new values.

Author:
Mark S. Miller

Field Summary
private  Object myValue
           
private  ValueGuard myValueGuard
           
 
Constructor Summary
(package private) SettableSlot(ValueGuard valueGuard, Object specimen, OneArgFunc optEjector)
          MyValueGuard is valueGuard, and my initial value is the specimen coerced by valueGuard.
 
Method Summary
 void __printOn(TextWriter out)
          Enabled:
 Object getValue()
          Enabled: The most recently stored value.
 void setValue(Object specimen)
          Enabled: Store the coercion of the specimen.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myValueGuard

private final ValueGuard myValueGuard

myValue

private Object myValue
Constructor Detail

SettableSlot

SettableSlot(ValueGuard valueGuard,
             Object specimen,
             OneArgFunc optEjector)
MyValueGuard is valueGuard, and my initial value is the specimen coerced by valueGuard.

Method Detail

getValue

public Object getValue()
Enabled: The most recently stored value.

Specified by:
getValue in interface Slot

setValue

public void setValue(Object specimen)
Enabled: Store the coercion of the specimen. Since no ejector can be provided, coercion failure is always thrown.

Specified by:
setValue in interface Slot

__printOn

public void __printOn(TextWriter out)
               throws IOException
Enabled:

IOException


comments?