public static class Sorter.SortRule extends Object implements Comparator<weka.knowledgeflow.steps.Sorter.InstanceHolder>
| Constructor and Description |
|---|
SortRule()
Constructor
|
SortRule(String setup)
Constructor
|
SortRule(String att,
boolean descending)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
int |
compare(weka.knowledgeflow.steps.Sorter.InstanceHolder o1,
weka.knowledgeflow.steps.Sorter.InstanceHolder o2)
Compare two instances according to the rule
|
String |
getAttribute()
Get the name or index of the attribute to sort on
|
boolean |
getDescending()
Return true if the sort is descending
|
void |
init(Environment env,
Instances structure)
Initialize the rule
|
void |
setAttribute(String att)
Set the name or index of the attribute to sort on
|
void |
setDescending(boolean d)
Set whether the sort should be descending rather than ascending
|
String |
toString()
Prints the rule in human readable format
|
String |
toStringInternal()
Gets the rule in internal format
|
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic SortRule(String att, boolean descending)
att - the name or index of the attribute to compare ondescending - true if order should be descendingpublic SortRule()
public SortRule(String setup)
setup - the definition of a sort rulepublic String toStringInternal()
public String toString()
public void setAttribute(String att)
att - the name or index of tha attribute to sort onpublic String getAttribute()
public void setDescending(boolean d)
d - true for a descending sortpublic boolean getDescending()
public void init(Environment env, Instances structure)
env - the environment variables to usestructure - the structure of the instances that the rule will
opperate onpublic int compare(weka.knowledgeflow.steps.Sorter.InstanceHolder o1,
weka.knowledgeflow.steps.Sorter.InstanceHolder o2)
compare in interface Comparator<weka.knowledgeflow.steps.Sorter.InstanceHolder>o1 - the first instanceo2 - the second instanceCopyright © 2016 University of Waikato, Hamilton, NZ. All Rights Reserved.