Top Description Fields Constructors Methods
org.hsqldb.util.preprocessor

public Class Defines

extends Object
Class Inheritance
Annotations
@SuppressWarnings:ClassWithoutLogger
Imports
java.util.HashMap, .Map

A simple Preprocessor symbol table.
Author
Campbell Burnet (campbell-burnet@users dot sourceforge.net)
Since
1.8.1
Version
2.7.0

Field Summary

Modifier and TypeField and Description
private final Map<String, Object>

Constructor Summary

AccessConstructor and Description
public
Defines()

Constructs a new, empty instance.

public
Defines(final String
a comma-separated list of Preprocessor expressions; may be null or empty, in which case no symbols are added.
csvExpressions
)

Constructs a new instance initially defined using the comma-separated list of Preprocessor expressions.

Method Summary

Modifier and TypeMethod and Description
public void
clear()

removes all defined symbols.

public void
defineCSV(final String
a comma-separated list of Preprocessor expressions; may be null or empty, in which case no symbols are added.
csvExpressions
)

adds the given comma-separated list of Preprocessor expressions to the symbol table.

public void
defineSingle(final String
to add; may be null or empty, in which case no action is taken.
expression
)

adds a single Preprocessor expression to the symbol table.

public boolean
evaluate(final String expression)

public Object
getDefintion(final String symbol)

public boolean
isDefined(final String symbol)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public void
undefine(final String symbol)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

symbolsback to summary
private final Map<String, Object> symbols

Constructor Detail

Definesback to summary
public Defines()

Constructs a new, empty instance.

Definesback to summary
public Defines(final String csvExpressions) throws PreprocessorException

Constructs a new instance initially defined using the comma-separated list of Preprocessor expressions.

Parameters
csvExpressions:String

a comma-separated list of Preprocessor expressions; may be null or empty, in which case no symbols are added.

Exceptions
PreprocessorException:
if the given list contains an illegal expression.
See Also
defineCSV(String)

Method Detail

clearback to summary
public void clear()

removes all defined symbols.

defineCSVback to summary
public void defineCSV(final String csvExpressions) throws PreprocessorException

adds the given comma-separated list of Preprocessor expressions to the symbol table.

Parameters
csvExpressions:String

a comma-separated list of Preprocessor expressions; may be null or empty, in which case no symbols are added.

Exceptions
PreprocessorException:
if the given list contains an illegal expression.
defineSingleback to summary
public void defineSingle(final String expression) throws PreprocessorException

adds a single Preprocessor expression to the symbol table.

Parameters
expression:String

to add; may be null or empty, in which case no action is taken.

Exceptions
PreprocessorException:
if the given expression is illegal or has trailing tokens.
evaluateback to summary
public boolean evaluate(final String expression) throws PreprocessorException
getDefintionback to summary
public Object getDefintion(final String symbol)
isDefinedback to summary
public boolean isDefined(final String symbol)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
undefineback to summary
public void undefine(final String symbol)