Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6311023

javax.swing.DefaultRowSorter.sort() method description is not clear

XMLWordPrintable

    • b53
    • generic
    • generic

      Spec for method javax.swing.DefaultRowSorter.sort() contains the following text:
      " Sorts and filters the rows in the view based on the sort keys of the columns currently being sorted and the filter, if any, associated with this sorter."

      It would be really nice to clarify the following things:

      - how the sort keys influence on the sorting? For example, what happens if sort keys list contain more than one key (as I understand it has affect on sorting if model contains several equal values in the same column). In what order these keys are taken into account by the sort() method. What if several keys have the same column index?

      - what way the sorting happens? It is not obvious that while sorting method sort() move the whole row (based on the first sort key in the list) but not just the value in the column currently being sorted (based on the sort key of this column).

      - does the sentence "If the sort keys have changed this triggers a sort." mean that method sort() is invoked?
      Spec for method javax.swing.DefaultRowSorter.sort() contains the following text:
      " Sorts and filters the rows in the view based on the sort keys of the columns currently being sorted and the filter, if any, associated with this sorter."

      It would be really nice to clarify the following things:

      - how the sort keys influence on the sorting? For example, what happens if sort keys list contain more than one key (as I understand it has affect on sorting if model contains several equal values in the same column). In what order these keys are taken into account by the sort() method. What if several keys have the same column index?

      - what way the sorting happens? It is not obvious that while sorting method sort() move the whole row (based on the first sort key in the list) but not just the value in the column currently being sorted (based on the sort key of this column).

      - does the sentence "If the sort keys have changed this triggers a sort." mean that method sort() is invoked?

            svioletsunw Scott Violet (Inactive)
            ynovozhi Yulia Novozhilova (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: