[]
        
(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>
Specifies the criterion used to sort data.

Use this enum to identify whether a sort field orders data by cell values, cell color, font color, or cell icons. It is commonly returned by ISortField.getSortOn() to describe how a sort field evaluates the target range.


 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
      Specifies that sorting is based on cell values.
    • CellColor

      public static final SortOnType CellColor
      Specifies that data is sorted based on cell color.
    • FontColor

      public static final SortOnType FontColor
      Specifies that data is sorted by font color.
    • CellIcon

      public static final SortOnType CellIcon
      Specifies that data is sorted based on cell icons.
  • 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