com.mhhe.clrs2e
Interface CountingSort.KeyExtractor

All Known Implementing Classes:
CountingSort.CountingSortKeyExtractor, RadixSort.RadixKeyExtractor
Enclosing interface:
CountingSort

public static interface CountingSort.KeyExtractor

Interface that allows us to pull out the sort key from an object. CountingSort and RadixSort have inner classes that implement this interface.


Method Summary
 int extract(int value)
          Extracts the key from an int.
 int extract(com.mhhe.clrs2e.NonNegativeInteger value)
          Extracts the key from a NonNegativeInteger.
 

Method Detail

extract

public int extract(int value)
Extracts the key from an int.

Parameters:
value - The int whose key is to be extracted.
Returns:
The extracted key.

extract

public int extract(com.mhhe.clrs2e.NonNegativeInteger value)
Extracts the key from a NonNegativeInteger.

Parameters:
value - The NonNegativeInteger whose key is to be extracted.
Returns:
The extracted key.