[]
        
首页
开发者学堂
文档
论坛
市场
生态机会
活动
立即试用
(Showing Draft Content)

ValidationOperator

Enum Class ValidationOperator

java.lang.Object
java.lang.Enum<ValidationOperator>
com.grapecity.documents.excel.ValidationOperator
All Implemented Interfaces:
Serializable, Comparable<ValidationOperator>, Constable

public enum ValidationOperator extends Enum<ValidationOperator>
指定数据验证用于将公式与单元格值比较的运算符;对于 Between 和 NotBetween,则用于比较两个公式。

将此枚举与 IValidation 一起使用,以定义验证规则如何计算输入。Between 和 NotBetween 需要两个公式参数,而其他运算符只使用第一个公式。


 IRange range = worksheet.getRange("A1");
 range.getValidation().add(
     ValidationType.Whole, ValidationAlertStyle.Stop, ValidationOperator.Between, 1, 10);
 
  • Enum Constant Details

  • Method Details

    • values

      public static ValidationOperator[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ValidationOperator valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null