gnu.expr
Class GenericProc

java.lang.Object
  |
  +--gnu.mapping.Procedure
        |
        +--gnu.mapping.ProcedureN
              |
              +--gnu.expr.MethodProc
                    |
                    +--gnu.expr.GenericProc

public class GenericProc
extends MethodProc

A collection of MethodProcs; one is chosen at apply time.


Fields inherited from class gnu.mapping.Procedure
noArgs, sym_name
 
Constructor Summary
GenericProc()
           
 
Method Summary
 void add(MethodProc method)
           
 java.lang.Object applyN(java.lang.Object[] args)
           
 java.lang.Object applyV(java.lang.Object vars)
           
 java.lang.Object getVarBuffer()
          Return a buffer that can contain decoded (matched) arguments.
 int isApplicable(Type[] args)
          Test if method is applicable to an invocation with given arguments.
 java.lang.RuntimeException match(java.lang.Object vars, java.lang.Object[] args)
          Match the incoming arguments.
 int numArgs()
          Return minArgs()|(maxArgs<<12).
 
Methods inherited from class gnu.expr.MethodProc
getParameterType, match, mostSpecific, mostSpecific, numParameters
 
Methods inherited from class gnu.mapping.ProcedureN
apply0, apply1, apply2, apply3, apply4
 
Methods inherited from class gnu.mapping.Procedure
apply, checkArgCount, getName, getSetter, maxArgs, minArgs, name, print, set0, set1, setN, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericProc

public GenericProc()
Method Detail

numArgs

public int numArgs()
Description copied from class: Procedure
Return minArgs()|(maxArgs<<12).
Overrides:
numArgs in class Procedure

add

public void add(MethodProc method)

applyN

public java.lang.Object applyN(java.lang.Object[] args)
Overrides:
applyN in class MethodProc

getVarBuffer

public java.lang.Object getVarBuffer()
Description copied from class: MethodProc
Return a buffer that can contain decoded (matched) arguments.
Overrides:
getVarBuffer in class MethodProc

isApplicable

public int isApplicable(Type[] args)
Description copied from class: MethodProc
Test if method is applicable to an invocation with given arguments. Returns -1 if no; 1 if yes; 0 if need to check at run-time.
Overrides:
isApplicable in class MethodProc

match

public java.lang.RuntimeException match(java.lang.Object vars,
                                        java.lang.Object[] args)
Description copied from class: MethodProc
Match the incoming arguments.
Overrides:
match in class MethodProc
Tags copied from class: MethodProc
Parameters:
args - the incoming argument list
vars - where to save the matched result on success
Returns:
null if the match succeeded, else an exception

applyV

public java.lang.Object applyV(java.lang.Object vars)
Overrides:
applyV in class MethodProc