Class RefGuardSugar

All Implemented Interfaces:
Auditor, Guard, Marker, Persistent, Serializable, SlotGuard, ValueGuard

public class RefGuardSugar
extends ClassDesc

Untamed: Refines the 'coerce/2' behavior of the Ref type, so that it may be useful as a ValueGuard (and as a SlotGuard).

The E programmer is never expected to see 'Ref' as a type, since this wouldn't be meaningful in E. Rather, this guard behavior is supported so that other values are coerces to NearRefs on deflection, when 'Ref' is used as a parameter of return type in a Java interface.

Mark S. Miller
See Also:
Serialized Form

Field Summary
(package private) static long serialVersionUID
Fields inherited from class org.erights.e.elib.base.ClassDesc
Fields inherited from class org.erights.e.elib.base.TypeDesc
Fields inherited from class org.erights.e.elib.slot.BaseGuard
Fields inherited from interface org.erights.e.elib.serial.Persistent
Constructor Summary
RefGuardSugar(Class clazz)
          Enabled: @param clazz must be Ref or a subtype
Method Summary
 Object subCoerce(Object specimen, OneArgFunc optEjector)
          Enabled: If specimen isn't already a Ref, wrap it in a NearRef.
Methods inherited from class org.erights.e.elib.base.ClassDesc
asClass, byJavaRules, coerce, flatName, flatSig, get, get, isFloating, isIntegral, make, sig, sig, simpleName, simpleSig
Methods inherited from class org.erights.e.elib.base.TypeDesc
getAuditors, getDocComment, getFQName, getMessageTypes, getName, prettyPrintOn, show, toString
Methods inherited from class org.erights.e.elib.slot.BaseAuditor
Methods inherited from class org.erights.e.elib.slot.BaseGuard
__printOn, accepts, and, butNot, coerce, makeSlot, makeSlot, not, or, xor
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail


static final long serialVersionUID
Constructor Detail


public RefGuardSugar(Class clazz)
Enabled: @param clazz must be Ref or a subtype

Method Detail


public Object subCoerce(Object specimen,
                        OneArgFunc optEjector)
Enabled: If specimen isn't already a Ref, wrap it in a NearRef.

subCoerce in class ClassDesc