public class FormulaEngineImpl extends Object implements FormulaEngine, Serializable
Modifier and Type | Class and Description |
---|---|
protected static class |
FormulaEngineImpl.ErrorFormulaExpressionImpl |
protected static class |
FormulaEngineImpl.EvalContext |
protected static class |
FormulaEngineImpl.EvaluationResultImpl |
protected static interface |
FormulaEngineImpl.FormulaAdjuster |
protected static class |
FormulaEngineImpl.FormulaExpressionImpl |
Modifier and Type | Field and Description |
---|---|
static String |
KEY_EVALUATORS |
protected static IStabilityClassifier |
noCacheClassifier |
KEY_EXTERNAL_BOOK_NAMES, KEY_FORMULA_CACHE, KEY_SHEET_INDEXES
Constructor and Description |
---|
FormulaEngineImpl() |
Modifier and Type | Method and Description |
---|---|
void |
clearCache(FormulaClearContext context) |
void |
clearColumnCache(FormulaClearContext context,
int start,
int end) |
static EvaluationResult |
convertToEvaluationResult(ValueEval value) |
EvaluationResult |
evaluate(FormulaExpression expr,
FormulaEvaluationContext context) |
protected EvaluationResult |
evaluateFormula(FormulaExpression expr,
FormulaEvaluationContext context,
EvalBook evalBook,
WorkbookEvaluator evaluator) |
protected ValueEval |
evaluateFormulaExpression(WorkbookEvaluator evaluator,
int sheetIndex,
FormulaExpression expr,
boolean ignoreDereference,
Ref dependent)
Deprecated.
|
protected ValueEval |
evaluateFormulaExpression(WorkbookEvaluator evaluator,
int sheetIndex,
FormulaExpression expr,
boolean ignoreDereference,
Ref dependent,
int[] offset)
Deprecated.
|
protected ValueEval |
evaluateFormulaExpression(WorkbookEvaluator evaluator,
int sheetIndex,
int rowIndex,
int columnIndex,
FormulaExpression expr,
boolean ignoreDereference,
Ref dependent,
int[] offset) |
FormulaExpression |
extend(String formula,
SheetRegion srcRegion,
boolean horizontal,
FormulaParseContext context) |
FormulaExpression |
extendPtgs(FormulaExpression fe,
SheetRegion srcRegion,
boolean horizontal,
FormulaParseContext context)
modify
FormulaExpression for cells insertion |
protected FormulaEngineImpl.FormulaAdjuster |
getMoveAdjuster(SheetRegion region,
int rowOffset,
int columnOffset) |
protected FormulaEngineImpl.FormulaAdjuster |
getRenameNameAdjuster(int sheetIndex,
String oldName,
String newName) |
protected FormulaEngineImpl.FormulaAdjuster |
getRenameSheetAdjuster(SBook targetBook,
String oldSheetName,
String newSheetName) |
protected FormulaEngineImpl.FormulaAdjuster |
getReorderSheetAdjuster(SBook targetBook,
int oldIndex,
int newIndex) |
protected static io.keikai.model.impl.sys.formula.FormulaEngineImpl.ResultValueEval |
getResolvedValue(ValueEval value) |
protected FormulaEngineImpl.FormulaAdjuster |
getShiftAdjuster(int rowOffset,
int columnOffset) |
protected FormulaEngineImpl.FormulaAdjuster |
getTransposeAdjuster(int rowOrigin,
int columnOrigin) |
protected Object |
getXelContext() |
FormulaExpression |
move(String formula,
SheetRegion region,
int rowOffset,
int columnOffset,
FormulaParseContext context)
Shift the formula that care on sheet and region.
|
FormulaExpression |
movePtgs(FormulaExpression fe,
SheetRegion region,
int rowOffset,
int columnOffset,
FormulaParseContext context)
Shift the formula that care on sheet and region for cells insertion, deletion, and paste
|
FormulaExpression |
parse(String formula,
FormulaParseContext context) |
Ptg[] |
parse(String formula,
FormulaParsingWorkbook book,
int sheetIndex,
FormulaParseContext context) |
FormulaExpression |
renameColumnNameTablePtgs(FormulaExpression fexpr,
STable table,
String oldName,
String newName,
FormulaParseContext context) |
FormulaExpression |
renameName(String formula,
SBook targetBook,
int sheetIndex,
String oldName,
String newName,
FormulaParseContext context) |
FormulaExpression |
renameName(String formula,
SBook targetBook,
String oldName,
String newName,
FormulaParseContext context) |
FormulaExpression |
renameNamePtgs(FormulaExpression fe,
SBook targetBook,
int sheetIndex,
String oldName,
String newName,
FormulaParseContext context) |
FormulaExpression |
renameSheet(String formula,
SBook targetBook,
String oldSheetName,
String newSheetName,
FormulaParseContext context) |
FormulaExpression |
renameSheetPtgs(FormulaExpression fe,
SBook targetBook,
String oldSheetName,
String newSheetName,
FormulaParseContext context) |
FormulaExpression |
renameTableNameTablePtgs(FormulaExpression fexpr,
SBook book,
String oldName,
String newName,
FormulaParseContext context) |
protected String |
renderFormula(ParsingBook parsingBook,
String formula,
Ptg[] tokens,
boolean always) |
FormulaExpression |
reorderSheetPtgs(FormulaExpression fexpr,
SBook targetBook,
int oldIndex,
int newIndex,
FormulaParseContext context) |
protected void |
setXelContext(Object ctx) |
FormulaExpression |
shift(String formula,
int rowOffset,
int columnOffset,
FormulaParseContext context)
Shift the formula base on the offset
|
FormulaExpression |
shiftPtgs(FormulaExpression fe,
int rowOffset,
int columnOffset,
FormulaParseContext context)
Shift the formula base on the offset
|
protected static boolean |
shouldNormalize(Locale runtimeLocale) |
FormulaExpression |
shrink(String formula,
SheetRegion srcRegion,
boolean horizontal,
FormulaParseContext context) |
FormulaExpression |
shrinkPtgs(FormulaExpression fe,
SheetRegion srcRegion,
boolean horizontal,
FormulaParseContext context)
modify
FormulaExpression for cells deletion |
protected Ref |
toDependRef(FormulaParseContext ctx,
ParsingBook parsingBook,
Ptg ptg,
int ptgIndex) |
FormulaExpression |
transpose(String formula,
int rowOrigin,
int columnOrigin,
FormulaParseContext context)
Transpose the formula base one the origin
|
FormulaExpression |
transposePtgs(FormulaExpression fe,
int rowOrigin,
int columnOrigin,
FormulaParseContext context)
Transpose the formula base one the origin
|
void |
updateDependencyTable(FormulaExpression fexpr,
FormulaParseContext context) |
public static final String KEY_EVALUATORS
protected static final IStabilityClassifier noCacheClassifier
public FormulaExpression parse(String formula, FormulaParseContext context)
parse
in interface FormulaEngine
protected static boolean shouldNormalize(Locale runtimeLocale)
public Ptg[] parse(String formula, FormulaParsingWorkbook book, int sheetIndex, FormulaParseContext context)
protected String renderFormula(ParsingBook parsingBook, String formula, Ptg[] tokens, boolean always)
protected Ref toDependRef(FormulaParseContext ctx, ParsingBook parsingBook, Ptg ptg, int ptgIndex)
public EvaluationResult evaluate(FormulaExpression expr, FormulaEvaluationContext context)
evaluate
in interface FormulaEngine
protected EvaluationResult evaluateFormula(FormulaExpression expr, FormulaEvaluationContext context, EvalBook evalBook, WorkbookEvaluator evaluator) throws FormulaParseException, Exception
FormulaParseException
Exception
public static EvaluationResult convertToEvaluationResult(ValueEval value) throws EvaluationException
EvaluationException
protected static io.keikai.model.impl.sys.formula.FormulaEngineImpl.ResultValueEval getResolvedValue(ValueEval value) throws EvaluationException
EvaluationException
protected Object getXelContext()
protected void setXelContext(Object ctx)
public void clearCache(FormulaClearContext context)
clearCache
in interface FormulaEngine
public void clearColumnCache(FormulaClearContext context, int start, int end)
clearColumnCache
in interface FormulaEngine
public FormulaExpression move(String formula, SheetRegion region, int rowOffset, int columnOffset, FormulaParseContext context)
FormulaEngine
move
in interface FormulaEngine
protected FormulaEngineImpl.FormulaAdjuster getMoveAdjuster(SheetRegion region, int rowOffset, int columnOffset)
public FormulaExpression shrink(String formula, SheetRegion srcRegion, boolean horizontal, FormulaParseContext context)
shrink
in interface FormulaEngine
public FormulaExpression extend(String formula, SheetRegion srcRegion, boolean horizontal, FormulaParseContext context)
extend
in interface FormulaEngine
public FormulaExpression shift(String formula, int rowOffset, int columnOffset, FormulaParseContext context)
FormulaEngine
shift
in interface FormulaEngine
protected FormulaEngineImpl.FormulaAdjuster getShiftAdjuster(int rowOffset, int columnOffset)
public FormulaExpression transpose(String formula, int rowOrigin, int columnOrigin, FormulaParseContext context)
FormulaEngine
transpose
in interface FormulaEngine
protected FormulaEngineImpl.FormulaAdjuster getTransposeAdjuster(int rowOrigin, int columnOrigin)
public FormulaExpression renameSheet(String formula, SBook targetBook, String oldSheetName, String newSheetName, FormulaParseContext context)
renameSheet
in interface FormulaEngine
protected FormulaEngineImpl.FormulaAdjuster getRenameSheetAdjuster(SBook targetBook, String oldSheetName, String newSheetName)
public FormulaExpression renameName(String formula, SBook targetBook, String oldName, String newName, FormulaParseContext context)
renameName
in interface FormulaEngine
public FormulaExpression renameName(String formula, SBook targetBook, int sheetIndex, String oldName, String newName, FormulaParseContext context)
renameName
in interface FormulaEngine
protected FormulaEngineImpl.FormulaAdjuster getRenameNameAdjuster(int sheetIndex, String oldName, String newName)
public FormulaExpression movePtgs(FormulaExpression fe, SheetRegion region, int rowOffset, int columnOffset, FormulaParseContext context)
FormulaEngine
movePtgs
in interface FormulaEngine
public FormulaExpression shrinkPtgs(FormulaExpression fe, SheetRegion srcRegion, boolean horizontal, FormulaParseContext context)
FormulaEngine
FormulaExpression
for cells deletionshrinkPtgs
in interface FormulaEngine
public FormulaExpression extendPtgs(FormulaExpression fe, SheetRegion srcRegion, boolean horizontal, FormulaParseContext context)
FormulaEngine
FormulaExpression
for cells insertionextendPtgs
in interface FormulaEngine
public FormulaExpression shiftPtgs(FormulaExpression fe, int rowOffset, int columnOffset, FormulaParseContext context)
FormulaEngine
shiftPtgs
in interface FormulaEngine
public FormulaExpression transposePtgs(FormulaExpression fe, int rowOrigin, int columnOrigin, FormulaParseContext context)
FormulaEngine
transposePtgs
in interface FormulaEngine
public FormulaExpression renameSheetPtgs(FormulaExpression fe, SBook targetBook, String oldSheetName, String newSheetName, FormulaParseContext context)
renameSheetPtgs
in interface FormulaEngine
public FormulaExpression renameNamePtgs(FormulaExpression fe, SBook targetBook, int sheetIndex, String oldName, String newName, FormulaParseContext context)
renameNamePtgs
in interface FormulaEngine
public void updateDependencyTable(FormulaExpression fexpr, FormulaParseContext context)
updateDependencyTable
in interface FormulaEngine
@Deprecated protected ValueEval evaluateFormulaExpression(WorkbookEvaluator evaluator, int sheetIndex, FormulaExpression expr, boolean ignoreDereference, Ref dependent)
@Deprecated protected ValueEval evaluateFormulaExpression(WorkbookEvaluator evaluator, int sheetIndex, FormulaExpression expr, boolean ignoreDereference, Ref dependent, int[] offset)
protected ValueEval evaluateFormulaExpression(WorkbookEvaluator evaluator, int sheetIndex, int rowIndex, int columnIndex, FormulaExpression expr, boolean ignoreDereference, Ref dependent, int[] offset)
public FormulaExpression reorderSheetPtgs(FormulaExpression fexpr, SBook targetBook, int oldIndex, int newIndex, FormulaParseContext context)
reorderSheetPtgs
in interface FormulaEngine
protected FormulaEngineImpl.FormulaAdjuster getReorderSheetAdjuster(SBook targetBook, int oldIndex, int newIndex)
public FormulaExpression renameTableNameTablePtgs(FormulaExpression fexpr, SBook book, String oldName, String newName, FormulaParseContext context)
renameTableNameTablePtgs
in interface FormulaEngine
public FormulaExpression renameColumnNameTablePtgs(FormulaExpression fexpr, STable table, String oldName, String newName, FormulaParseContext context)
renameColumnNameTablePtgs
in interface FormulaEngine
Copyright © 2020. All rights reserved.