jAudioFeatureExtractor.GeneralTools
クラス Sorter

java.lang.Object
  上位を拡張 jAudioFeatureExtractor.GeneralTools.Sorter

public class Sorter
extends java.lang.Object

A holder class for static methods relating to sorting.

作成者:
Cory McKay
関連項目:
Collator

コンストラクタの概要
Sorter()
           
 
メソッドの概要
static int[] getDoubleArraySortKey(double[] to_sort)
          Takes in an array of doubles and returns an array holding the rankings from lowest (0) to highest (to_sort -1) of each entry from lowest to highest.
static double[] sortDoubleArray(double[] to_sort)
          Takes in an array of doubles and returns a copy of the array sorted from lowest to highest.
static java.lang.String[][] sortTable(java.lang.String[][] original_table, int column_to_sort_by, int[] sorted_ordering)
          Takes a two dimensional String array representing a table (column indice first, then row indice) and returns a copy of the table sorted by the data in the given column indice.
static javax.swing.tree.DefaultMutableTreeNode sortTree(javax.swing.tree.DefaultMutableTreeNode root_unsorted_tree)
          Takes the tree with the given root and reorders it so that all siblings are sorted alphebetically.
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

Sorter

public Sorter()
メソッドの詳細

sortTree

public static javax.swing.tree.DefaultMutableTreeNode sortTree(javax.swing.tree.DefaultMutableTreeNode root_unsorted_tree)
Takes the tree with the given root and reorders it so that all siblings are sorted alphebetically. Recurses through the children so that each level is sorted alphabetically. Returns the root of the new sorted tree.

パラメータ:
root_unsorted_tree - The root of the tree to be sorted.
戻り値:
A copy of the tree that has been sorted.
関連項目:
Collator, DefaultMutableTreeNode

sortTable

public static java.lang.String[][] sortTable(java.lang.String[][] original_table,
                                             int column_to_sort_by,
                                             int[] sorted_ordering)
Takes a two dimensional String array representing a table (column indice first, then row indice) and returns a copy of the table sorted by the data in the given column indice.

The sorted_ordering array is filled to reflect the positions that the old rows were assigned to. This array should have the same size as the number of rows of the original_table parameter. The original values of the sorted_ordering array are irrelevant.

パラメータ:
original_table - The table to be sorted.
column_to_sort_by - The column to base the sort on.
sorted_ordering - The number position assigned to each row after sorting.
戻り値:
A copy of the table that has been sorted.
関連項目:
Collator

sortDoubleArray

public static double[] sortDoubleArray(double[] to_sort)
Takes in an array of doubles and returns a copy of the array sorted from lowest to highest. The orignal array is not altered.

パラメータ:
to_sort - The data that is to be sorted.
戻り値:
A copy of the array sorted from lowest to highest.

getDoubleArraySortKey

public static int[] getDoubleArraySortKey(double[] to_sort)
Takes in an array of doubles and returns an array holding the rankings from lowest (0) to highest (to_sort -1) of each entry from lowest to highest. The orignal array is not altered.

パラメータ:
to_sort - The data that is to be sorted.
戻り値:
The rankings of to_sort.