Class SortContainer

    • Field Detail

      • m_File

        protected FileObject m_File
        the file object to be sorted.
      • m_Sort

        protected Comparable m_Sort
        used for sorting.
    • Constructor Detail

      • SortContainer

        public SortContainer​(FileObject file,
                             Sorting sorting)
        Initializes the sort container.
        Parameters:
        file - the file object to sort
        sorting - the type of sorting to perform
    • Method Detail

      • getFile

        public FileObject getFile()
        Returns the stored file.
        Returns:
        the stored file
      • compareTo

        public int compareTo​(SortContainer o)
        Compares this container with the specified container for order. Returns a negative integer, zero, or a positive integer as this container is less than, equal to, or greater than the specified container.
        Specified by:
        compareTo in interface Comparable<SortContainer>
        Parameters:
        o - the subrange 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.
      • 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.
      • hashCode

        public int hashCode()
        Hashcode so can be used as hashtable key. Returns the hashcode of the file.
        Overrides:
        hashCode in class Object
        Returns:
        the hashcode
      • toString

        public String toString()
        Returns a string representation of the file and the object used for sorting.
        Overrides:
        toString in class Object
        Returns:
        the representation