Package weka.gui
Class SortedTableModel.SortContainer
- java.lang.Object
-
- weka.gui.SortedTableModel.SortContainer
-
- All Implemented Interfaces:
java.lang.Comparable<SortedTableModel.SortContainer>
- Enclosing class:
- SortedTableModel
public static class SortedTableModel.SortContainer extends java.lang.Object implements java.lang.Comparable<SortedTableModel.SortContainer>
Helper class for sorting the columns.
-
-
Constructor Summary
Constructors Constructor Description SortContainer(java.lang.Comparable value, int index)
Initializes the container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(SortedTableModel.SortContainer o)
Compares this object with the specified object for order.boolean
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.int
getIndex()
Returns the original index of the item.java.lang.Comparable
getValue()
Returns the value to sort on.java.lang.String
toString()
Returns a string representation of the sort container.
-
-
-
Method Detail
-
getValue
public java.lang.Comparable getValue()
Returns the value to sort on.- Returns:
- the value
-
getIndex
public int getIndex()
Returns the original index of the item.- Returns:
- the index
-
compareTo
public int compareTo(SortedTableModel.SortContainer o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. Null is considered smallest. If both values are null, then 0 is returned.- Specified by:
compareTo
in interfacejava.lang.Comparable<SortedTableModel.SortContainer>
- Parameters:
o
- the object to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
- Throws:
java.lang.ClassCastException
- if the specified object's type prevents it from being compared to this object.
-
equals
public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- the reference object with which to compare.- Returns:
- true if this object is the same as the obj argument; false otherwise.
- Throws:
java.lang.ClassCastException
- if the specified object's type prevents it from being compared to this object.
-
toString
public java.lang.String toString()
Returns a string representation of the sort container.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the string representation (value + index)
-
-