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

SortOnType

Enum Class SortOnType

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

public enum SortOnType extends Enum<SortOnType>
指定用于对数据排序的条件。

使用此枚举可以标识排序字段是按单元格值、单元格颜色、字体颜色还是单元格图标对数据排序。它通常由 ISortField.getSortOn() 返回,用于描述排序字段如何评估目标区域。


 worksheet.getRange("A1:A3").setValue(new Object[][] {
     {"Name"},
     {"Bob"},
     {"Alice"}
 });
 IValueSortField sortField = new ValueSortField(worksheet.getRange("A1:A3"), SortOrder.Ascending);
 if (sortField.getSortOn() == SortOnType.Values) {
     worksheet.getRange("A1:A3").sort(SortOrientation.Columns, false, sortField);
 }
 
  • Enum Constant Details

    • Values

      public static final SortOnType Values
      指定排序基于单元格值。
    • CellColor

      public static final SortOnType CellColor
      指定数据按单元格颜色排序。
    • FontColor

      public static final SortOnType FontColor
      指定数据按字体颜色排序。
    • CellIcon

      public static final SortOnType CellIcon
      指定按单元格图标对数据进行排序。
  • Method Details

    • values

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