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
ConstructorsConstructorDescriptionMacroDeclarationsCompositor(MacroDeclarations... declarations) Constructs aMacroDeclarationsCompositorcontaining the provided declarations -
Method Summary
-
Constructor Details
-
MacroDeclarationsCompositor
Constructs aMacroDeclarationsCompositorcontaining 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:
hasMacroin 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 ofMacroDeclarationsapplies here too.- Specified by:
getMacroin interfaceMacroDeclarations- Parameters:
name- the name of the macro to be fetched- Returns:
- a macro
-