Package net.sf.basedb.util.jep
Class FunctionSafeJep.SafeFunctionTable
- java.lang.Object
-
- java.util.Dictionary<K,V>
-
- java.util.Hashtable
-
- org.nfunk.jep.FunctionTable
-
- net.sf.basedb.util.jep.FunctionSafeJep.SafeFunctionTable
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Map
- Enclosing class:
- FunctionSafeJep
static class FunctionSafeJep.SafeFunctionTable extends FunctionTable
Function table implementation that pretends that all possible functions exists, but sends an error message if someone tries to use a function that doesn't really exists.
-
-
Field Summary
Fields Modifier and Type Field Description private FunctionSafeJep
jep
private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description SafeFunctionTable(FunctionSafeJep jep)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(Object key)
If the key is already registered, return TRUE.private String
nextToken(String token)
Get the next token in the parser.private void
readObject(ObjectInputStream ois)
private void
writeObject(ObjectOutputStream ois)
-
Methods inherited from class org.nfunk.jep.FunctionTable
get, get, put, put
-
Methods inherited from class java.util.Hashtable
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsValue, elements, entrySet, equals, forEach, getOrDefault, hashCode, isEmpty, keys, keySet, merge, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, size, toString, values
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
jep
private final FunctionSafeJep jep
-
-
Constructor Detail
-
SafeFunctionTable
SafeFunctionTable(FunctionSafeJep jep)
-
-
Method Detail
-
containsKey
public boolean containsKey(Object key)
If the key is already registered, return TRUE. If the key is not registered and is a function, register it as an unknown function, set an error message and return TRUE. Otherwise return FALSE.- Specified by:
containsKey
in interfaceMap
- Overrides:
containsKey
in classHashtable
-
nextToken
private String nextToken(String token)
Get the next token in the parser. If this is a "(", the parse is currently looking up a function name.- Parameters:
token
- The current token
-
readObject
private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException
- Throws:
ClassNotFoundException
IOException
-
writeObject
private void writeObject(ObjectOutputStream ois) throws IOException
- Throws:
IOException
-
-