|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.archive.wayback.util.partition.Partitioner<T>
T - generic class type to use with this Partitionerpublic class Partitioner<T>
Class which divides a set of date-related objects into sub-sets by time ranges. This class provides methods for: 1) determining the smallest PartitionSize that can be used to cover a time range, using at most a set number of partitions 2) creating a List of Partition objects covering a span of time, each having a specified size 3) efficiently populating an iterator of date-related objects into List of Partition objects
| Field Summary | |
|---|---|
static PartitionSize |
daySize
PartitionSize based on Day intervals |
static PartitionSize |
hourSize
PartitionSize based on Hour intervals |
static PartitionSize |
monthSize
PartitionSize based on Month intervals |
static PartitionSize |
twoMonthSize
PartitionSize based on Two Month intervals |
static PartitionSize |
twoYearSize
PartitionSize based on Two Year intervals |
static PartitionSize |
weekSize
PartitionSize based on Week intervals |
static PartitionSize |
yearSize
PartitionSize based on Year intervals |
| Constructor Summary | |
|---|---|
Partitioner(ElementPartitionMap<T> map)
|
|
| Method Summary | |
|---|---|
void |
dumpPartitions(List<Partition<T>> partitions)
Debugging method |
List<Partition<T>> |
getRange(PartitionSize size,
Date start,
Date end)
Create a List of Partition objects of the specified size, which span the date range specified. |
PartitionSize |
getSize(Date first,
Date last,
int maxP)
Attempt to find the smallest PartitionSize implementation which, spanning the range first and last specified, produces at most maxP partitions. |
static PartitionSize |
getSize(String name)
Get a PartitionSize object by it's name |
void |
populate(List<Partition<T>> partitions,
Iterator<T> itr)
Add elements from itr into the appropriate partitions. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static PartitionSize hourSize
public static PartitionSize daySize
public static PartitionSize weekSize
public static PartitionSize monthSize
public static PartitionSize twoMonthSize
public static PartitionSize yearSize
public static PartitionSize twoYearSize
| Constructor Detail |
|---|
public Partitioner(ElementPartitionMap<T> map)
map - that converts from the Generic type used in this instance
to a Date, and adds a Generic type used to a Partition| Method Detail |
|---|
public static PartitionSize getSize(String name)
name - of the PartitionSize
public PartitionSize getSize(Date first,
Date last,
int maxP)
first - Date of beginning of time rangelast - Date of end of time rangemaxP - maximum number of Partitions to use
public List<Partition<T>> getRange(PartitionSize size,
Date start,
Date end)
size - of Partitions to createstart - Date of beginning of time range to coverend - Date of end of time range to cover
public void populate(List<Partition<T>> partitions,
Iterator<T> itr)
partitions - to populate with objectsitr - ascending Iterator of objects to place into the partitionspublic void dumpPartitions(List<Partition<T>> partitions)
partitions - to dump
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||