public class NumberedPartitionChunk<T> extends Object implements PartitionChunk<T>
Constructor and Description |
---|
NumberedPartitionChunk(int chunkNumber,
int chunks,
T object) |
Modifier and Type | Method and Description |
---|---|
boolean |
abuts(PartitionChunk<T> other)
Determines if this PartitionChunk abuts another PartitionChunk.
|
int |
compareTo(PartitionChunk<T> other) |
boolean |
equals(Object o) |
int |
getChunkNumber()
Returns the partition chunk number of this PartitionChunk.
|
T |
getObject()
Returns the payload, generally an object that can be used to perform some action against the shard.
|
int |
hashCode() |
boolean |
isEnd()
Returns true if this chunk is the end of the partition.
|
boolean |
isStart()
Returns true if this chunk is the beginning of the partition.
|
static <T> NumberedPartitionChunk<T> |
make(int chunkNumber,
int chunks,
T obj) |
public NumberedPartitionChunk(int chunkNumber, int chunks, T object)
public static <T> NumberedPartitionChunk<T> make(int chunkNumber, int chunks, T obj)
public T getObject()
PartitionChunk
getObject
in interface PartitionChunk<T>
public boolean abuts(PartitionChunk<T> other)
PartitionChunk
abuts
in interface PartitionChunk<T>
other
- input chunkpublic boolean isStart()
PartitionChunk
isStart
in interface PartitionChunk<T>
public boolean isEnd()
PartitionChunk
isEnd
in interface PartitionChunk<T>
public int getChunkNumber()
PartitionChunk
getChunkNumber
in interface PartitionChunk<T>
public int compareTo(PartitionChunk<T> other)
compareTo
in interface Comparable<PartitionChunk<T>>
Copyright © 2011–2017. All rights reserved.