Package adams.gui.core
Class SortableAndSearchableWrapperTableModel.SortContainer
- java.lang.Object
-
- adams.gui.core.SortableAndSearchableWrapperTableModel.SortContainer
-
- All Implemented Interfaces:
Comparable<SortableAndSearchableWrapperTableModel.SortContainer>
- Enclosing class:
- SortableAndSearchableWrapperTableModel
public static class SortableAndSearchableWrapperTableModel.SortContainer extends Object implements Comparable<SortableAndSearchableWrapperTableModel.SortContainer>
Helper class for sorting the columns.
-
-
Field Summary
Fields Modifier and Type Field Description protected int
m_Index
the index of the value.protected Comparable
m_Value
the value to sort.
-
Constructor Summary
Constructors Constructor Description SortContainer(Comparable value, int index)
Initializes the container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(SortableAndSearchableWrapperTableModel.SortContainer o)
Compares this object with the specified object for order.boolean
equals(Object obj)
Indicates whether some other object is "equal to" this one.int
getIndex()
Returns the original index of the item.Comparable
getValue()
Returns the value to sort on.String
toString()
Returns a string representation of the sort container.
-
-
-
Field Detail
-
m_Value
protected Comparable m_Value
the value to sort.
-
m_Index
protected int m_Index
the index of the value.
-
-
Constructor Detail
-
SortContainer
public SortContainer(Comparable value, int index)
Initializes the container.- Parameters:
value
- the value to sort onindex
- the original index
-
-
Method Detail
-
getValue
public 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(SortableAndSearchableWrapperTableModel.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 interfaceComparable<SortableAndSearchableWrapperTableModel.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:
ClassCastException
- if the specified object's type prevents it from being compared to this object.
-
equals
public boolean equals(Object obj)
Indicates whether some other object is "equal to" this one.- Overrides:
equals
in classObject
- Parameters:
obj
- the reference object with which to compare.- Returns:
- true if this object is the same as the obj argument; false otherwise.
- Throws:
ClassCastException
- if the specified object's type prevents it from being compared to this object.
-
-