public class EvaluationConditionalFormatRule extends java.lang.Object implements java.lang.Comparable<EvaluationConditionalFormatRule>
ConditionalFormattingEvaluator
. This references a rule, its owning
ConditionalFormatting
, its priority order (lower index = higher priority in Excel),
and the information needed to evaluate the rule for a given cell.
Having this all combined and cached avoids repeated access calls to the underlying structural objects, XSSF CT* objects and HSSF raw byte structures. Those objects can be referenced from here. This object will be out of sync if anything modifies the referenced structures' evaluation properties.
The assumption is that consuming applications will read the display properties once and create whatever style objects they need, caching those at the application level. Thus this class only caches values needed for evaluation, not display.
Modifier and Type | Class and Description |
---|---|
protected static class |
EvaluationConditionalFormatRule.ValueAndFormat
Note: this class has a natural ordering that is inconsistent with equals.
|
Constructor and Description |
---|
EvaluationConditionalFormatRule(WorkbookEvaluator workbookEvaluator,
Sheet sheet,
ConditionalFormatting formatting,
int formattingIndex,
ConditionalFormattingRule rule,
int ruleIndex,
CellRangeAddress[] regions) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(EvaluationConditionalFormatRule o)
Per Excel Help, XSSF rule priority is sheet-wide, not just within the owning ConditionalFormatting object.
|
boolean |
equals(java.lang.Object obj)
Defined as equal sheet name and formatting and rule indexes
|
java.util.Set<EvaluationConditionalFormatRule.ValueAndFormat> |
evaluateDuplicateValues(java.util.List<EvaluationConditionalFormatRule.ValueAndFormat> allValues) |
ConditionalFormatting |
getFormatting() |
int |
getFormattingIndex() |
java.lang.String |
getFormula1() |
java.lang.String |
getFormula2() |
ExcelNumberFormat |
getNumberFormat() |
org.apache.poi.ss.formula.OperatorEnum |
getOperator() |
int |
getPriority() |
CellRangeAddress[] |
getRegions() |
ConditionalFormattingRule |
getRule() |
int |
getRuleIndex() |
Sheet |
getSheet() |
java.lang.String |
getText() |
ConditionType |
getType() |
int |
hashCode() |
public EvaluationConditionalFormatRule(WorkbookEvaluator workbookEvaluator, Sheet sheet, ConditionalFormatting formatting, int formattingIndex, ConditionalFormattingRule rule, int ruleIndex, CellRangeAddress[] regions)
formattingIndex
- for priority, zero basedruleIndex
- for priority, zero based, if this is an HSSF rule. Unused for XSSF rulesregions
- could be read from formatting, but every call creates new objects in a new array.
this allows calling it once per formatting instance, and re-using the array.public Sheet getSheet()
public ConditionalFormatting getFormatting()
public int getFormattingIndex()
public ExcelNumberFormat getNumberFormat()
public ConditionalFormattingRule getRule()
public int getRuleIndex()
public CellRangeAddress[] getRegions()
public int getPriority()
public java.lang.String getFormula1()
public java.lang.String getFormula2()
public java.lang.String getText()
public org.apache.poi.ss.formula.OperatorEnum getOperator()
public ConditionType getType()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int compareTo(EvaluationConditionalFormatRule o)
HSSF priority is based on definition/persistence order.
compareTo
in interface java.lang.Comparable<EvaluationConditionalFormatRule>
public int hashCode()
hashCode
in class java.lang.Object
public java.util.Set<EvaluationConditionalFormatRule.ValueAndFormat> evaluateDuplicateValues(java.util.List<EvaluationConditionalFormatRule.ValueAndFormat> allValues)
Copyright 2022 The Apache Software Foundation or its licensors, as applicable.