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.
(与 ConditionalFormattingEvaluator 一起使用的条件格式规则的抽象和缓存版本。这引用了一个规则、它拥有的 ConditionalFormatting、它的优先级顺序(在 Excel 中较低的索引 = 较高的优先级)以及评估给定单元格的规则所需的信息。将所有这些组合起来并缓存起来可以避免对底层结构对象、XSSF CT* 对象和 HSSF 原始字节结构的重复访问调用。可以从这里引用这些对象。如果有任何东西修改了引用结构的评估属性,此对象将不同步。假设是消费应用程序将读取一次显示属性并创建他们需要的任何样式对象,并在应用程序级别缓存这些对象。因此,此类仅缓存评估所需的值,而不是显示。)Modifier and Type | Class and Description |
---|---|
static class |
EvaluationConditionalFormatRule.OperatorEnum
Not calling it OperatorType to avoid confusion for now with other classes.
(暂时不要称它为 OperatorType 以避免与其他类混淆。)
|
protected static class |
EvaluationConditionalFormatRule.ValueAndFormat
Note: this class has a natural ordering that is inconsistent with equals.
(注意:此类具有与 equals 不一致的自然顺序。)
|
protected static interface |
EvaluationConditionalFormatRule.ValueFunction
instances evaluate the values for a region and return the positive matches for the function type.
(实例评估区域的值并返回函数类型的正匹配。)
|
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.
(根据 Excel 帮助,XSSF 规则优先级是工作表范围的,而不仅仅是在拥有的 ConditionalFormatting 对象内。)
|
boolean |
equals(java.lang.Object obj)
Defined as equal sheet name and formatting and rule indexes
(定义为相等的工作表名称和格式以及规则索引)
|
ConditionalFormatting |
getFormatting() |
int |
getFormattingIndex() |
java.lang.String |
getFormula1() |
java.lang.String |
getFormula2() |
ExcelNumberFormat |
getNumberFormat() |
EvaluationConditionalFormatRule.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)
workbookEvaluator
-
(工作簿评估员 -)
sheet
-
(床单 -)
formatting
-
(格式化 -)
formattingIndex
- for priority, zero based
(formattingIndex - 优先级,从零开始)
rule
-
(规则 -)
ruleIndex
- for priority, zero based, if this is an HSSF rule. Unused for XSSF rules
(ruleIndex - 优先级,从零开始,如果这是一个 HSSF 规则。未用于 XSSF 规则)
regions
- 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 EvaluationConditionalFormatRule.OperatorEnum getOperator()
public ConditionType getType()
public boolean equals(java.lang.Object obj)
equals
in class
java.lang.Object
Object.equals(java.lang.Object)
public int compareTo(EvaluationConditionalFormatRule o)
HSSF priority is based on definition/persistence order.
(根据 Excel 帮助,XSSF 规则优先级是工作表范围的,而不仅仅是在拥有的 ConditionalFormatting 对象内。这可以通过创建适用于两个不同范围的 4 条规则并检查 XML 来看出。 HSSF 优先级基于定义/持久性顺序。)compareTo
in interface
java.lang.Comparable<EvaluationConditionalFormatRule>
(接口 java.lang.Comparable 中的 compareTo
o
-
(这 -)
public int hashCode()
hashCode
in class
java.lang.Object
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.