net.sf.jga.parser
Interface FunctorParser

All Known Implementing Classes:
GenericParser, JFXGParser, ScriptParser

public interface FunctorParser

Parses strings containing JXFG scripts and produces functors.

Copyright © 2005 David A. Hall


Method Summary
 java.lang.Class<?> getReturnType()
          Returns the type of object returned by the last functor parsed.
<T1,T2> BinaryFunctor<T1,T2,?>
parseBinary(java.lang.String str, java.lang.Class<T1> arg1Type, java.lang.Class<T2> arg2Type)
          Parses the string to create a BinaryFunctor that takes arguments of the given types.
 Generator<?> parseGenerator(java.lang.String str)
          Parses the string to create a Generator.
<T1> UnaryFunctor<T1,?>
parseUnary(java.lang.String str, java.lang.Class<T1> argType)
          Parses the string to create a UnaryFunctor that takes an argument of the given type.
 

Method Detail

parseGenerator

Generator<?> parseGenerator(java.lang.String str)
                            throws ParseException
Parses the string to create a Generator.

Throws:
ParseException

parseUnary

<T1> UnaryFunctor<T1,?> parseUnary(java.lang.String str,
                                   java.lang.Class<T1> argType)
                              throws ParseException
Parses the string to create a UnaryFunctor that takes an argument of the given type.

Throws:
ParseException

parseBinary

<T1,T2> BinaryFunctor<T1,T2,?> parseBinary(java.lang.String str,
                                           java.lang.Class<T1> arg1Type,
                                           java.lang.Class<T2> arg2Type)
                                   throws ParseException
Parses the string to create a BinaryFunctor that takes arguments of the given types.

Throws:
ParseException

getReturnType

java.lang.Class<?> getReturnType()
Returns the type of object returned by the last functor parsed.

Throws:
java.lang.IllegalStateException - if the parser has not been used or if parsing the last functor resulted in an exception being thrown.


Copyright © 2002-2006 David A. Hall. All Rights Reserved.