|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Untamed:
Method Summary | |
boolean |
accepts(Object specimen)
Enabled: Would coerce(specimen, ...) succeed? |
Guard |
and(Guard other)
Enabled: Coercion pipe, or function composition of guards. |
Guard |
butNot(Guard other)
Enabled: (x &! y) is equivalent to (x & !y). |
Object |
coerce(Object specimen)
Enabled: guard.coerce(x) should be equivalent to guard.coerce(x, null) |
Guard |
get()
Enabled: guard[] should return a guard that coerces a ConstList to a ConstList in which every element has been coerced by guard. |
Slot |
makeSlot(Object specimen)
Enabled: guard.makeSlot(x) should be equivalent to guard.makeSlot(x, null) |
Guard |
not()
Enabled: (!x).coerce(specimen) succeeds exactly when x.coerce(specimen) fails. |
Guard |
or(Guard other)
Enabled: Union type. |
Guard |
xor(Guard other)
Enabled: (x ^ y) is equivalent to ((x &! y) | (!x & y)). |
Methods inherited from interface org.erights.e.elib.slot.SlotGuard |
getName, makeSlot |
Methods inherited from interface org.erights.e.elib.slot.ValueGuard |
coerce, getName |
Method Detail |
public Object coerce(Object specimen)
public boolean accepts(Object specimen)
Yes means the specimen is acceptable input to the guard, not that it is a possible output.
public Slot makeSlot(Object specimen)
public Guard get()
public Guard or(Guard other)
(x | y | z).coerce(specimen) tries x, y, and z in left to right order on specimen until one succeeds or they all fail. It yield the last outcome.
other
-
public Guard and(Guard other)
(x & y & z).coerce(specimen) is equivalent to
z.coerce(y.coerce(x.coerce(specimen)))When x and y are non-transforming guards (either failing or passing specimen through as is), then this effectively forms an intersection type.
other
-
public Guard not()
(!x) is a non-transforming guard, whether or not x is.
public Guard butNot(Guard other)
other
-
public Guard xor(Guard other)
other
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |