org.archive.wayback.util.partition.size
Class TwoMonthPartitionSize

java.lang.Object
  extended by org.archive.wayback.util.partition.size.TwoMonthPartitionSize
All Implemented Interfaces:
PartitionSize

public class TwoMonthPartitionSize
extends Object
implements PartitionSize

PartitionSize which aligns on two Month partitions

Author:
brad

Field Summary
 
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
 
Constructor Summary
TwoMonthPartitionSize()
           
 
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
 

Constructor Detail

TwoMonthPartitionSize

public TwoMonthPartitionSize()
Method Detail

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.