Comparison interface, designed for comparing elements in some data array.
Unlike the standard java.util.Comparator, the basic method {@link #less(long,long)}of this interface works not with data elements, but with their indexes in the array: this method should get them from the analysed array itself. So, every object, implementing this interface, is supposed to be working with some fixed linear data array. The method of storing data in the array can be any; for example, it can be an {@link Array AlgART array}or a usual Java array. The length of the array is limited only by 263−1 (maximal possible value for long indexes).
This interface is used by {@link ArraySorter} class.
AlgART Laboratory 2007–2014
@author Daniel Alievsky @version 1.2 @since JDK 1.5
|
|