public class OptionalNumber extends java.lang.Object implements java.lang.Comparable<OptionalNumber>
This class provides table row sorting for columns that normally contain a number but may also contain a string sometimes.
Strings that cannot be cast to a number will be sorted as if they had a negative value.
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
display |
java.lang.Long |
value |
Constructor and Description |
---|
OptionalNumber(java.lang.Object value)
Creates a comparable (sortable) wrapper object for a table cell with an optional number.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(OptionalNumber o) |
java.lang.String |
toString()
Returns the value to displayed in the table cell.
|
public OptionalNumber(java.lang.Object value)
Creates a comparable (sortable) wrapper object for a table cell with an optional number.
value
- The value to be displayed.public int compareTo(OptionalNumber o)
compareTo
in interface java.lang.Comparable<OptionalNumber>
public java.lang.String toString()
Returns the value to displayed in the table cell.
toString
in class java.lang.Object