Exchanging interface, designed for exchanging (swapping) two elements in some data array.
The basic method {@link #swap(long,long)}of this interface works with indexes of the exchanged elements in the array. 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 UpdatableArray updatable 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.
Note: {@link UpdatableArray} interface extends this interface.
AlgART Laboratory 2007–2014
@author Daniel Alievsky @version 1.2 @since JDK 1.5
|
|