net.fortytwo.ripple.model
Class Closure

java.lang.Object
  extended by net.fortytwo.ripple.model.Closure
All Implemented Interfaces:
Mapping<StackContext,StackContext,RippleException>, StackMapping

public class Closure
extends Object
implements StackMapping


Constructor Summary
Closure(StackMapping innerMapping, RippleValue argument)
           
 
Method Summary
 void apply(StackContext arg, Sink<StackContext,RippleException> solutions)
           
 int arity()
           
 StackMapping getInverse()
           
 boolean isTransparent()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Closure

public Closure(StackMapping innerMapping,
               RippleValue argument)
Parameters:
innerMapping - a mapping
argument - an inactive value
Method Detail

arity

public int arity()
Specified by:
arity in interface StackMapping
Returns:
the fixed number of arguments which this function consumes before computing a result.

apply

public void apply(StackContext arg,
                  Sink<StackContext,RippleException> solutions)
           throws RippleException
Specified by:
apply in interface Mapping<StackContext,StackContext,RippleException>
Throws:
RippleException

isTransparent

public boolean isTransparent()
Specified by:
isTransparent in interface Mapping<StackContext,StackContext,RippleException>
Returns:
whether this function is referentially transparent w.r.t. all of its parameters.

toString

public String toString()
Overrides:
toString in class Object

getInverse

public StackMapping getInverse()
                        throws RippleException
Specified by:
getInverse in interface StackMapping
Returns:
the StackMapping exactly inverse to this mapping, or a NullMapping if no such mapping can be defined.
Throws:
RippleException - if the inverse cannot be determined


Copyright © 2007-2011 fortytwo.net. All Rights Reserved.