javax.time.calendar
Class CalendricalMatchers

java.lang.Object
  extended by javax.time.calendar.CalendricalMatchers

public final class CalendricalMatchers
extends java.lang.Object

Provides common implementations of CalendricalMatcher.

These matchers are useful and common implementations of CalendricalMatcher. A matcher allows any type of matching to be performed against a calendrical. Examples might be checking of the calendrical represents Friday the Thirteenth, or the last day of the month, or one of the American continent time-zones. All the implemented matchers depend on the ISO calendar system.

This is a thread-safe utility class. All matchers returned are immutable and thread-safe.

Author:
Michael Nascimento Santos, Stephen Colebourne

Method Summary
static CalendricalMatcher lastDayOfMonth()
          Returns the last day-of-month matcher, which returns true if the date is the last valid day of the month.
static CalendricalMatcher lastDayOfYear()
          Returns the last day-of-year matcher, which returns true if the date is the last valid day of the year.
static CalendricalMatcher leapDay()
          Returns the leap day matcher, which returns true if the date is February 29th in a leap year.
static CalendricalMatcher leapYear()
          Returns the leap year matcher, which returns true if the date is in a leap year.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

leapYear

public static CalendricalMatcher leapYear()
Returns the leap year matcher, which returns true if the date is in a leap year.

The input 2011-01-15 will return false.
The input 2012-01-15 will return true (leap year).

Returns:
the leap year matcher, not null

leapDay

public static CalendricalMatcher leapDay()
Returns the leap day matcher, which returns true if the date is February 29th in a leap year.

The input 2011-02-27 will return false.
The input 2011-02-28 will return false.
The input 2012-02-28 will return false (leap year).
The input 2012-02-29 will return true (leap year).

Returns:
the leap day matcher, not null

lastDayOfMonth

public static CalendricalMatcher lastDayOfMonth()
Returns the last day-of-month matcher, which returns true if the date is the last valid day of the month.

The input 2011-02-27 will return false.
The input 2011-02-28 will return true.
The input 2012-02-28 will return false (leap year).
The input 2012-02-29 will return true (leap year).

Returns:
the last day-of-month matcher, not null

lastDayOfYear

public static CalendricalMatcher lastDayOfYear()
Returns the last day-of-year matcher, which returns true if the date is the last valid day of the year.

The input 2011-12-30 will return false.
The input 2011-12-31 will return true.

Returns:
the last day-of-year matcher, not null