Package adams.core.io.lister
Class SortContainer
- java.lang.Object
-
- adams.core.io.lister.SortContainer
-
- All Implemented Interfaces:
Comparable<SortContainer>
public class SortContainer extends Object implements Comparable<SortContainer>
A helper class for sorting file objects.- Version:
- $Revision: 13700 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description protected FileObject
m_File
the file object to be sorted.protected Comparable
m_Sort
used for sorting.
-
Constructor Summary
Constructors Constructor Description SortContainer(FileObject file, Sorting sorting)
Initializes the sort container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(SortContainer o)
Compares this container with the specified container for order.boolean
equals(Object obj)
Indicates whether some other object is "equal to" this one.FileObject
getFile()
Returns the stored file.int
hashCode()
Hashcode so can be used as hashtable key.String
toString()
Returns a string representation of the file and the object used for sorting.
-
-
-
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 sortsorting
- 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 interfaceComparable<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.
-
hashCode
public int hashCode()
Hashcode so can be used as hashtable key. Returns the hashcode of the file.
-
-