[]
        
(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>
Specifies whether a search matches against the whole cell content or any part of it.

Used with FindOptions.setLookAt(LookAt) and ReplaceOptions.setLookAt(LookAt) to control the matching behavior of IRange.find(Object,IRange,FindOptions) and 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
      Matches any part of the cell content.
    • Whole

      public static final LookAt Whole
      Matches the whole cell content.
  • 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.