sdr 0.7

net.cscott.sdr.calls.transform
Class Finish.PartSelectorCall

java.lang.Object
  extended by net.cscott.sdr.calls.ExprFunc<Evaluator>
      extended by net.cscott.sdr.calls.Call
          extended by net.cscott.sdr.calls.transform.Finish.PartSelectorCall
Enclosing class:
Finish

public abstract static class Finish.PartSelectorCall
extends Call

Helper class to define concepts based on this class (and subclasses of it).


Nested Class Summary
 
Nested classes/interfaces inherited from class net.cscott.sdr.calls.ExprFunc
ExprFunc.EvaluationException
 
Constructor Summary
Finish.PartSelectorCall(String name, Program program, String rule)
           
 
Method Summary
 List<Expr> getDefaultArguments()
          Return argument defaults, if there are any for this call.
 Evaluator getEvaluator(DanceState ds, List<Expr> args)
          Returns the Evaluator to use on the result of an application.
 int getMinNumberOfArguments()
          Return the number of arguments which should, at minimum, be given to this Call.
 String getName()
          The name of this call, in our internal jargon.
protected abstract  Finish getPartsVisitor(DanceState ds)
           
 Program getProgram()
          The program to which this particular call or concept belongs.
 Rule getRule()
          Returns the grammar rule applicable to this call, or null, if there is none (ie, this is an internal call).
 
Methods inherited from class net.cscott.sdr.calls.Call
equals, evaluate, hashCode, makeSimpleCall, toString
 
Methods inherited from class net.cscott.sdr.calls.ExprFunc
isConstant
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Finish.PartSelectorCall

public Finish.PartSelectorCall(String name,
                               Program program,
                               String rule)
Method Detail

getName

public final String getName()
Description copied from class: Call
The name of this call, in our internal jargon. This is not guaranteed to be identical to the wording a caller would use; we do some reordering and rewording to make our internal representation regular and unambigous.

Specified by:
getName in class Call

getProgram

public final Program getProgram()
Description copied from class: Call
The program to which this particular call or concept belongs.

Specified by:
getProgram in class Call

getRule

public Rule getRule()
Description copied from class: Call
Returns the grammar rule applicable to this call, or null, if there is none (ie, this is an internal call).

Specified by:
getRule in class Call

getDefaultArguments

public List<Expr> getDefaultArguments()
Description copied from class: Call
Return argument defaults, if there are any for this call. The list may contain any number of entries (including 0). Arguments off the end of the returned list, as well as arguments whose corresponding entry in the list is null, have no default.

Specified by:
getDefaultArguments in class Call

getMinNumberOfArguments

public int getMinNumberOfArguments()
Description copied from class: Call
Return the number of arguments which should, at minimum, be given to this Call. Usually this is the exact number of arguments required, but some combining calls (like 'and') can take an arbitrary number of arguments.

Specified by:
getMinNumberOfArguments in class Call

getEvaluator

public Evaluator getEvaluator(DanceState ds,
                              List<Expr> args)
                       throws ExprFunc.EvaluationException
Description copied from class: Call
Returns the Evaluator to use on the result of an application. The Evaluator.hasSimpleExpansion() method of the Evaluator will return true if this call can be simply expanded; use the Evaluator.simpleExpansion() method to obtain the expansion. Otherwise the call should be considered 'opaque' and requires use of the custom Evaluator.)

Specified by:
getEvaluator in class Call
args - identical to the args argument of ExprFunc.evaluate(Class, DanceState, List).
Throws:
ExprFunc.EvaluationException

getPartsVisitor

protected abstract Finish getPartsVisitor(DanceState ds)

sdr 0.7

Copyright © 2006-2009 C. Scott Ananian