Class SortableAndSearchableWrapperTableModel.SortContainer

    • 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 on
        index - 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 interface Comparable<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 class 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:
        ClassCastException - if the specified object's type prevents it from being compared to this object.
      • toString

        public String toString()
        Returns a string representation of the sort container.
        Overrides:
        toString in class Object
        Returns:
        the string representation (value + index)