Class MacroDeclarationsCompositor
java.lang.Object
weka.core.expressionlanguage.common.MacroDeclarationsCompositor
- All Implemented Interfaces:
MacroDeclarations
A helper class that allows to combine several macro declarations together.
It can be though of as layering several scopes over one another.
It will delegate the
hasMacro(String)
and getMacro(String)
methods to other macro declarations.
Each macro declaration combined is checked in sequential order.
No checks for conflicts are done. Thus shadowing is possible.- Version:
- $Revision: 1000 $
- Author:
- Benjamin Weber ( benweber at student dot ethz dot ch )
-
Constructor Summary
ConstructorDescriptionMacroDeclarationsCompositor
(MacroDeclarations... declarations) Constructs aMacroDeclarationsCompositor
containing the provided declarations -
Method Summary
-
Constructor Details
-
MacroDeclarationsCompositor
Constructs aMacroDeclarationsCompositor
containing the provided declarations The order of the declarations will determine the order of checking the declarations for macros.- Parameters:
declarations
- the declarations being combined
-
-
Method Details
-
hasMacro
Whether the macro is contained in one of the combined declarations.- Specified by:
hasMacro
in interfaceMacroDeclarations
- Parameters:
name
- name of the macro- Returns:
- whether the macro is contained in one of the combined declarations
-
getMacro
Tries to fetch a macro from one of the combined declarations. The same invariant ofMacroDeclarations
applies here too.- Specified by:
getMacro
in interfaceMacroDeclarations
- Parameters:
name
- the name of the macro to be fetched- Returns:
- a macro
-