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

SortDataOption

Enum Class SortDataOption

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

public enum SortDataOption extends Enum<SortDataOption>
指定排序期间如何处理文本值。

将此枚举与基于值的排序字段一起使用,可以控制看起来像数字的文本是作为数值数据排序,还是将数值和文本值分开排序。


 worksheet.getRange("A1:A4").setValue(new Object[][] {
     {"Value"},
     {"10"},
     {"2"},
     {3}
 });
 ValueSortField sortField = new ValueSortField(worksheet.getRange("A2:A4"));
 sortField.setDataOption(SortDataOption.TextAsNumbers);
 
  • Enum Constant Details

    • TextAsNumbers

      public static final SortDataOption TextAsNumbers
      指定将文本作为数字数据进行排序。
    • Normal

      public static final SortDataOption Normal
      对数值和文本数据分别进行排序。
  • Method Details

    • values

      public static SortDataOption[] 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 SortDataOption 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