|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--org.erights.e.elib.slot.BaseGuard
Safe:
| Field Summary | |
protected ValueGuard |
myOptValueGuard
|
| Constructor Summary | |
BaseGuard()
Enabled: If you override coerce/2 in a subclass, call this constructor in order to effectively provide "this" as an argument. |
|
BaseGuard(ValueGuard optValueGuard)
Enabled: Provide a non-null optValueGuard to provide an explicit object to be used as the optional ValueGuard. |
|
| Method Summary | |
void |
__printOn(TextWriter out)
Enabled: Same as "<" + getName() + ">". |
boolean |
accepts(Object specimen)
Enabled: |
Guard |
and(Guard other)
Enabled: |
Guard |
butNot(Guard other)
Enabled: |
Object |
coerce(Object specimen)
Enabled: |
Object |
coerce(Object specimen,
OneArgFunc optEjector)
Enabled: Returns specimen as coerced through the optional valueGuard. |
Guard |
get()
Enabled: |
String |
getName()
Enabled: "settable" or "settable(value-guard-name)". |
Slot |
makeSlot(Object specimen)
Enabled: |
Slot |
makeSlot(Object specimen,
OneArgFunc optEjector)
Enabled: Returns a settable slot that coerces specimens (including the initial value) through the optional valueGuard. |
Guard |
not()
Enabled: |
Guard |
or(Guard other)
Enabled: |
String |
toString()
Suppressed: Same as getName() |
Guard |
xor(Guard other)
Enabled: |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected final ValueGuard myOptValueGuard
| Constructor Detail |
public BaseGuard(ValueGuard optValueGuard)
In the latter case, your overriding coerce/2 method should not call super.coerce/2. Likewise with getName/0.
Call this with null to indicate the indentity coercion.
public BaseGuard()
| Method Detail |
public String getName()
getName in interface SlotGuard
public Object coerce(Object specimen,
OneArgFunc optEjector)
coerce in interface ValueGuardpublic Object coerce(Object specimen)
coerce in interface Guardspecimen -
public boolean accepts(Object specimen)
accepts in interface Guard
public Slot makeSlot(Object specimen,
OneArgFunc optEjector)
makeSlot in interface SlotGuardpublic Slot makeSlot(Object specimen)
makeSlot in interface Guardspecimen -
public Guard get()
get in interface Guardpublic Guard or(Guard other)
or in interface Guardother -
public Guard and(Guard other)
and in interface Guardother -
public Guard not()
not in interface Guardpublic Guard butNot(Guard other)
butNot in interface Guardother -
public Guard xor(Guard other)
xor in interface Guardother -
public String toString()
toString in class Object
public void __printOn(TextWriter out)
throws IOException
IOException
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||