org.archive.wayback.util.partition.size
Class YearPartitionSize
java.lang.Object
org.archive.wayback.util.partition.size.YearPartitionSize
- All Implemented Interfaces:
- PartitionSize
public class YearPartitionSize
- extends Object
- implements PartitionSize
PartitionSize which aligns on one Year partitions
- Author:
- brad
| Fields inherited from interface org.archive.wayback.util.partition.PartitionSize |
DAY_IN_MONTH, DAY_IN_WEEK, DAY_IN_YEAR, DAY_NAME, HOUR_IN_DAY, HOUR_NAME, MONTH_NAME, MS_IN_DAY, MS_IN_HOUR, MS_IN_MONTH, MS_IN_SEC, MS_IN_TWO_MONTH, MS_IN_TWO_YEAR, MS_IN_WEEK, MS_IN_YEAR, SEC_IN_HOUR, TWO_MONTH_NAME, TWO_YEAR_NAME, WEEK_NAME, YEAR_NAME |
|
Method Summary |
void |
alignStart(Calendar in)
Align the calendar argument to the start of the interval covered by
this size. |
Calendar |
increment(Calendar start,
int offset)
Create a new Calendar object, aligned relative to the Calendar argument,
either forward or backward some number of partitions. |
long |
intervalMS()
|
String |
name()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
YearPartitionSize
public YearPartitionSize()
name
public String name()
- Specified by:
name in interface PartitionSize
- Returns:
- the name of this PartitionSize. Likely useful for localized
lookup of human readable text from a properties file.
intervalMS
public long intervalMS()
- Specified by:
intervalMS in interface PartitionSize
- Returns:
- the estimated number of milliseconds covered by this
PartitionSize. Note that this is estimated because of different number of
days in a month, leap days, leap seconds, etc.
alignStart
public void alignStart(Calendar in)
- Description copied from interface:
PartitionSize
- Align the calendar argument to the start of the interval covered by
this size. Calling this method on a DayPartitionSize will align the
Calendar to the beginning of the Day in which the Calendar's Date object
falls within.
- Specified by:
alignStart in interface PartitionSize
- Parameters:
in - Calendar object which has internal Date set
increment
public Calendar increment(Calendar start,
int offset)
- Description copied from interface:
PartitionSize
- Create a new Calendar object, aligned relative to the Calendar argument,
either forward or backward some number of partitions.
- Specified by:
increment in interface PartitionSize
- Parameters:
start - the returned Calendar will be aligned one day, week, month,
etc. ahead or behind of this Calendar argument.offset - the relative distance to move the returned calendar
relative to the argument Calendar.
- Returns:
- a new Calendar aligned relative to the start Calendar.
Copyright © 2005-2011 Internet Archive. All Rights Reserved.