|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.cm.frw.core.fun.impl.Function de.cm.frw.core.fun.impl.LP.ConsCell
public static class LP.ConsCell
A functional implementation of an (immutable) cons cell where values for car and cdr are captured in a closure when the cons cell function is created. The cons cell function takes either 0, or 1 as a parameter to access car or cdr ...
Nested Class Summary |
---|
Nested classes/interfaces inherited from class de.cm.frw.core.fun.impl.Function |
---|
Function.InvalidArguments |
Method Summary | |
---|---|
void |
checkArguments(java.util.Collection args)
Override this method to check conditions on the arguments (like types) passed to the function in apply before the operate method is called. |
boolean |
isEmpty()
|
java.lang.Object |
operate(java.lang.Object[] operands)
Override this to implement the actual operation realized by this function. |
java.lang.String |
toString()
|
Methods inherited from class de.cm.frw.core.fun.impl.Function |
---|
apply, apply, apply, apply, apply, apply, apply, apply, apply, apply, apply, apply, apply, apply, apply, apply, apply, apply, arity, box, box, box, box, box, box, box, box, box, box, box, box, box, box, box, is, main, map, map, reduce, unbox, val |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public boolean isEmpty()
public java.lang.String toString()
toString
in class java.lang.Object
public void checkArguments(java.util.Collection args) throws Function.InvalidArguments
Function
checkArguments
in class Function
Function.InvalidArguments
public java.lang.Object operate(java.lang.Object[] operands) throws Function.InvalidArguments
Function
Remember to document the number and types of the operands
and any other conditions for running the operate method.
Or implement checkArguments
instead.
Default implementation returns first argument passed in, realizing sort of an unary identity function.
operate
in class Function
operands
- An array of the arguments that where passed to apply
Function.InvalidArguments
- when you implement it to do so ...
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |