Modifier and Type | Method and Description |
---|---|
int |
partitionFor(T elem,
int numPartitions)
Chooses the partition into which to put the given element.
|
int partitionFor(T elem, int numPartitions)
elem
- the element to be partitionednumPartitions
- the total number of partitions (>= 1
)[0..numPartitions-1]
)