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

SearchDirection

Enum Class SearchDirection

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

public enum SearchDirection extends Enum<SearchDirection>
指定使用 IRange.find(Object,IRange,FindOptions) 方法时在区域中搜索的方向。

与 FindOptions.setSearchDirection(SearchDirection) 一起使用,可以控制搜索是在区域中向前( Next)还是向后( Previous)进行。


 worksheet.getRange("A1:A3").setValue(new Object[][] {{10}, {20}, {10}});
 IRange searchRange = worksheet.getRange("A1:A3");
 
 FindOptions options = new FindOptions();
 options.setSearchDirection(SearchDirection.Previous);
 IRange found = searchRange.find(10, null, options);
 
  • Enum Constant Details

    • Next

      public static final SearchDirection Next
      在范围内搜索下一个匹配的值。
    • Previous

      public static final SearchDirection Previous
      在范围内搜索上一个匹配的值。
  • Method Details

    • values

      public static SearchDirection[] 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 SearchDirection 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 search direction.
      Returns:
      The ordinal value.
    • forValue

      public static SearchDirection forValue(int value)
      Gets the search direction that corresponds to the specified ordinal value.
      Parameters:
      value - The ordinal value.
      Returns:
      The matching search direction.