|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.mhhe.clrs2e.RadixSort.RadixKeyExtractor
Interface that allows us to pull out the sort key from an object.
Field Summary | |
private int |
divisor
The divisor for extracting. |
private int |
extractorRadix
The radix for extracting. |
Constructor Summary | |
RadixSort.RadixKeyExtractor(int radix,
int divisor)
Initializes the radix and divisor. |
Method Summary | |
int |
extract(int value)
Extracts the key from an int , where the key is
the ith digit in base extractorRadix , and
assuming that extractorRadix ^i. |
int |
extract(com.mhhe.clrs2e.NonNegativeInteger value)
Extracts the key from an NonNegativeInteger ,
where the key is the ith digit in base
extractorRadix , and assuming that
extractorRadix ^i. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private int extractorRadix
private int divisor
Constructor Detail |
public RadixSort.RadixKeyExtractor(int radix, int divisor)
radix
- Radix used.divisor
- Divisor used.Method Detail |
public int extract(int value)
int
, where the key is
the ith digit in base extractorRadix
, and
assuming that extractorRadix
^i.
extract
in interface CountingSort.KeyExtractor
value
- The int
whose key is to be
extracted.
public int extract(com.mhhe.clrs2e.NonNegativeInteger value)
NonNegativeInteger
,
where the key is the ith digit in base
extractorRadix
, and assuming that
extractorRadix
^i.
extract
in interface CountingSort.KeyExtractor
value
- The NonNegativeInteger
whose key
is to be extracted.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |