bb.util
Class DateUtil.DateInfo

java.lang.Object
  extended by bb.util.DateUtil.DateInfo
Enclosing class:
DateUtil

private static final class DateUtil.DateInfo
extends Object

Stores various calendar related qualities of a Date, such as its era, year, etc. (Currently only stores information down to the day level because the search algorithm inside getDateInfo is day based.)

This class is multithread safe: it has no mutable state.


Field Summary
private  long dayLength
           
private  int dayOfMonth
           
private  int dayOfWeek
           
private  int dayOfYear
           
private  long dayStart
           
private  int era
           
private  boolean isLeapDay
           
private  int leapSecond
          -1 if is a negative leap second day (has never happened as of 2005/3/22), 0 if no leap second, +1 if is a positive leap second day (a normal leap second).
private  int month
           
private  Date monthStart
           
private  DateUtil.TimeZoneChange timeZoneChange
           
private  int weekOfMonth
           
private  int weekOfYear
           
private  Date weekStart
           
private  int year
           
private  Date yearStart
           
 
Constructor Summary
private DateUtil.DateInfo(Date date)
           
 
Method Summary
private  boolean isFor(long time)
          Returns true if this instance is suitable for time, false otherwise.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

era

private final int era

year

private final int year

yearStart

private final Date yearStart

month

private final int month

monthStart

private final Date monthStart

weekOfMonth

private final int weekOfMonth

weekOfYear

private final int weekOfYear

weekStart

private final Date weekStart

dayOfYear

private final int dayOfYear

dayOfMonth

private final int dayOfMonth

dayOfWeek

private final int dayOfWeek

dayStart

private final long dayStart

dayLength

private final long dayLength

isLeapDay

private final boolean isLeapDay

timeZoneChange

private final DateUtil.TimeZoneChange timeZoneChange

leapSecond

private final int leapSecond
-1 if is a negative leap second day (has never happened as of 2005/3/22), 0 if no leap second, +1 if is a positive leap second day (a normal leap second).

Constructor Detail

DateUtil.DateInfo

private DateUtil.DateInfo(Date date)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

isFor

private boolean isFor(long time)
Returns true if this instance is suitable for time, false otherwise. Here, time is the usual absolute time measurement used by Java (i.e. the number of milliseconds since the epoch), and the suitability criteria is whether or not time falls inside the day defined by this instance.