org.erights.e.elib.slot
Class AnyGuard

java.lang.Object
  |
  +--org.erights.e.elib.slot.BaseGuard
        |
        +--org.erights.e.elib.slot.AnyGuard
All Implemented Interfaces:
Guard, SlotGuard, ValueGuard

public final class AnyGuard
extends BaseGuard

Safe: The "any" guard behavior -- don't worry, be happy.

As a ValueGuard, accepts everything without any coercion (the identity coercion). As a SlotGuard, makes a coercion-free settable slot. The object named "any" delegates to the one AnyGuard.

Author:
Mark S. Miller

Field Summary
static AnyGuard THE_ONE
          Enabled: The one instance
 
Fields inherited from class org.erights.e.elib.slot.BaseGuard
myOptValueGuard
 
Constructor Summary
private AnyGuard()
           
 
Method Summary
 Object coerce(Object specimen, OneArgFunc optEjector)
          Enabled: Any specimen is acceptable as is, so return the specimen unchanged.
 String getName()
          Enabled:
 Slot makeSlot(Object specimen, OneArgFunc optEjector)
          Enabled: Returns a settable slot that does no coercion, ie, a SimpleSlot.
 
Methods inherited from class org.erights.e.elib.slot.BaseGuard
__printOn, accepts, and, butNot, coerce, get, makeSlot, not, or, toString, xor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

THE_ONE

public static final AnyGuard THE_ONE
Enabled: The one instance

Constructor Detail

AnyGuard

private AnyGuard()
Method Detail

getName

public String getName()
Enabled:

Specified by:
getName in interface SlotGuard
Overrides:
getName in class BaseGuard

coerce

public Object coerce(Object specimen,
                     OneArgFunc optEjector)
Enabled: Any specimen is acceptable as is, so return the specimen unchanged.

Specified by:
coerce in interface ValueGuard
Overrides:
coerce in class BaseGuard

makeSlot

public Slot makeSlot(Object specimen,
                     OneArgFunc optEjector)
Enabled: Returns a settable slot that does no coercion, ie, a SimpleSlot.

Specified by:
makeSlot in interface SlotGuard
Overrides:
makeSlot in class BaseGuard


comments?