2.17.2: 2011-06-17

net.sf.basedb.util.jep.convert
Class AbstractJepConversionFunction<T>

java.lang.Object
  extended by net.sf.basedb.util.jep.convert.AbstractJepConversionFunction<T>
All Implemented Interfaces:
JepConversionFunction<T>
Direct Known Subclasses:
AbsConverter, AddConverter, AndConverter, ASTConstantConverter, ASTFunNodeConverter, ASTVarNodeConverter, DivideConverter, EqualsConverter, ExpConverter, FloatConverter, GreaterConverter, GreaterEqualsConverter, IfConverter, IntegerConverter, LessConverter, LessEqualsConverter, LogarithmConverter, MultiplyConverter, NaturalLogarithmConverter, NotConverter, NotEqualsConverter, OrConverter, SquareRootConverter, StringConverter, SubtractConverter, UMinusConverter

public abstract class AbstractJepConversionFunction<T>
extends Object
implements JepConversionFunction<T>

Abstract superclass implementing the JepConversionFunction interface. This class throws an UnsupportedOperationException for the toExpression(Object) and toRestriction(Object) methods. A subclass should override at least one of the methods.

Version:
2.4
Author:
nicklas
Last modified
$Date: 2008-09-11 22:08:14 +0200 (Thu, 11 Sep 2008) $

Constructor Summary
protected AbstractJepConversionFunction()
           
 
Method Summary
 String getDescription()
          Get a short description of the function or operator
 String getName()
          Get the name of the function or the symbol of the operator
 boolean isFunction()
          If this converter is a built-in function.
 boolean isOperator()
          If this converter is a built-in operator.
 Expression toExpression(T node)
          Convert the object to an expression.
 Restriction toRestriction(T node)
          Convert the object to a restriction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractJepConversionFunction

protected AbstractJepConversionFunction()
Method Detail

isFunction

public boolean isFunction()
Description copied from interface: JepConversionFunction
If this converter is a built-in function. Built-in functions are automatically put in the enumeration return by Jep.getFunctions().

Specified by:
isFunction in interface JepConversionFunction<T>
Returns:
Always FALSE

isOperator

public boolean isOperator()
Description copied from interface: JepConversionFunction
If this converter is a built-in operator.

Specified by:
isOperator in interface JepConversionFunction<T>
Returns:
Always FALSE

getName

public String getName()
Description copied from interface: JepConversionFunction
Get the name of the function or the symbol of the operator

Specified by:
getName in interface JepConversionFunction<T>
Returns:
Always null

getDescription

public String getDescription()
Description copied from interface: JepConversionFunction
Get a short description of the function or operator

Specified by:
getDescription in interface JepConversionFunction<T>
Returns:
Always null

toExpression

public Expression toExpression(T node)
Description copied from interface: JepConversionFunction
Convert the object to an expression.

Specified by:
toExpression in interface JepConversionFunction<T>
Parameters:
node - The object to convert
Returns:
An expression or null
Throws:
UnsupportedOperationException - Always

toRestriction

public Restriction toRestriction(T node)
Description copied from interface: JepConversionFunction
Convert the object to a restriction.

Specified by:
toRestriction in interface JepConversionFunction<T>
Parameters:
node - The object to convert
Returns:
A restriction or null
Throws:
UnsupportedOperationException - Always

2.17.2: 2011-06-17