|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mondrian.olap.fun.FunTableImpl
public abstract class FunTableImpl
Abstract implementation of FunTable
.
The derived class must implement defineFunctions()
to define
each function which will be recognized by this table. This method is called
from the constructor, after which point, no further functions can be added.
Field Summary | |
---|---|
protected List<FunInfo> |
funInfoList
|
protected Map<String,List<Resolver>> |
mapNameToResolvers
Maps the upper-case name of a function plus its Syntax to an array of
Validator objects for that name. |
protected List<Resolver> |
resolverList
used during initialization |
Constructor Summary | |
---|---|
protected |
FunTableImpl()
|
Method Summary | |
---|---|
protected void |
addFunInfo(Resolver resolver)
|
protected void |
define(FunDef funDef)
|
protected void |
define(Resolver resolver)
|
protected abstract void |
defineFunctions()
This method is called from the constructor, to define the set of functions and reserved words recognized. |
protected void |
defineProperty(String s)
Defines a word matching a property function name. |
protected void |
defineReserved(String s)
Defines a reserved word. |
FunDef |
getDef(Exp[] args,
Validator validator,
String funName,
Syntax syntax)
Resolves a function call to a particular function. |
List<FunInfo> |
getFunInfoList()
Returns a list of FunInfo objects. |
List<String> |
getReservedWords()
Returns a list of words ( String ) which may not be used as
identifiers. |
List<Resolver> |
getResolvers()
Returns a list of Resolver objects. |
void |
init()
Initializes the function table. |
boolean |
isProperty(String s)
Returns whether a string is a property-style (postfix) operator. |
boolean |
isReserved(String s)
Returns whether a string is a reserved word. |
protected static String |
makeResolverKey(String name,
Syntax syntax)
|
protected void |
organizeFunctions()
Indexes the collection of functions. |
boolean |
requiresExpression(UnresolvedFunCall call,
int k,
Validator validator)
Returns whether the k th argument to a function call
has to be an expression. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Map<String,List<Resolver>> mapNameToResolvers
Syntax
to an array of
Validator
objects for that name.
protected final List<Resolver> resolverList
protected final List<FunInfo> funInfoList
Constructor Detail |
---|
protected FunTableImpl()
Method Detail |
---|
public void init()
protected static String makeResolverKey(String name, Syntax syntax)
protected void define(FunDef funDef)
protected void define(Resolver resolver)
protected void addFunInfo(Resolver resolver)
public FunDef getDef(Exp[] args, Validator validator, String funName, Syntax syntax)
FunTable
getDef
in interface FunTable
public boolean requiresExpression(UnresolvedFunCall call, int k, Validator validator)
FunTable
k
th argument to a function call
has to be an expression.
requiresExpression
in interface FunTable
public List<String> getReservedWords()
FunTable
String
) which may not be used as
identifiers.
getReservedWords
in interface FunTable
public boolean isReserved(String s)
FunTable
isReserved
in interface FunTable
protected void defineReserved(String s)
isReserved(java.lang.String)
public List<Resolver> getResolvers()
FunTable
Resolver
objects.
getResolvers
in interface FunTable
public boolean isProperty(String s)
FunTable
isProperty
in interface FunTable
protected void defineProperty(String s)
isProperty(java.lang.String)
public List<FunInfo> getFunInfoList()
FunTable
FunInfo
objects.
getFunInfoList
in interface FunTable
protected void organizeFunctions()
protected abstract void defineFunctions()
Each function is declared by calling define(mondrian.olap.FunDef)
. Each reserved
word is declared by calling defineReserved(String)
.
Derived class can override this method to add more functions.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |