TUM CCSM Commons

edu.tum.cs.commons.collections
Interface ISortableData


public interface ISortableData

Abstraction for sortable/comparable data. Implementations of this interface can be used with SortableDataUtils to supports basic algorithms, such as sorting and binary search on any data which can be mapped to a random access list. The main benefit of this interface is that the type of data is operated on must not be known (or be a concrete type), thus it can also be used to sort data spread over multiple lists or arrays.

Version:
$Rev: 28499 $
Author:
hummelb, $Author: deissenb $
Rating:
GREEN Hash: 8FEEC55647374909933C02DCDA3F8DE8

Method Summary
 boolean isLess(int i, int j)
          Returns whether the element stored at index i is smaller than the one stored at j.
 int size()
          Returns the number of elements.
 void swap(int i, int j)
          Swaps the elements at the given indices.
 

Method Detail

size

int size()
Returns the number of elements.


isLess

boolean isLess(int i,
               int j)
Returns whether the element stored at index i is smaller than the one stored at j.


swap

void swap(int i,
          int j)
Swaps the elements at the given indices.


TUM CCSM Commons

TUM CCSM Commons - 2.7