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

LookAt

Enum Class LookAt

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

public enum LookAt extends Enum<LookAt>
指定搜索是匹配整个单元格内容还是匹配其中任意部分。

与 FindOptions.setLookAt(LookAt) 和 ReplaceOptions.setLookAt(LookAt) 一起使用,可控制 IRange.find(Object,IRange,FindOptions) 和 IRange.replace(Object,Object,ReplaceOptions) 的匹配行为。


 worksheet.getRange("A1").setValue("Hello World");
 worksheet.getRange("A2").setValue("Hello");
 
 FindOptions options = new FindOptions();
 options.setLookAt(LookAt.Whole);
 IRange found = worksheet.getRange("A1:A2").find("Hello", null, options);
 // found refers to A2, because only "Hello" matches the whole cell content
 
  • Enum Constant Details

    • Part

      public static final LookAt Part
      匹配单元格内容的任意部分。
    • Whole

      public static final LookAt Whole
      匹配整个单元格内容。
  • Method Details

    • values

      public static LookAt[] 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 LookAt 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
    • getValue

      public int getValue()
      Gets the ordinal value of this match mode.
      Returns:
      The ordinal value.
    • forValue

      public static LookAt forValue(int value)
      Gets the match mode that corresponds to the specified ordinal value.
      Parameters:
      value - The ordinal value.
      Returns:
      The matching match mode.