Holger's
Java API

com.antelmann.calendar
Class Holiday

java.lang.Object
  extended by com.antelmann.calendar.Holiday
All Implemented Interfaces:
Serializable, Comparable<Holiday>

public class Holiday
extends Object
implements Serializable, Comparable<Holiday>

represents a holiday

Since:
Feb 2006
Author:
Holger Antelmann
See Also:
HolidayCalendar, Serialized Form

Constructor Summary
Holiday(String name, Date date)
          calls this(name, date, true, null)
Holiday(String name, Date date, boolean isPublic, Locale locale)
           
 
Method Summary
 int compareTo(Holiday h)
          based on the date
 boolean equals(Object obj)
          based on both, name and date
 Date getDate()
          the date is stored as the beginning of the corresponding day
 Locale getLocale()
          returns the locale associated with this holiday.
 String getName()
           
 int hashCode()
           
 boolean isPublic()
          determines whether this holiday is considered to be a so-called bank holiday
 String toString()
          returns the localized date along with the name
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Holiday

public Holiday(String name,
               Date date)
calls this(name, date, true, null)


Holiday

public Holiday(String name,
               Date date,
               boolean isPublic,
               Locale locale)
Method Detail

getName

public String getName()

getDate

public Date getDate()
the date is stored as the beginning of the corresponding day

See Also:
CalendarUtils.dayBegin(Date)

isPublic

public boolean isPublic()
determines whether this holiday is considered to be a so-called bank holiday


getLocale

public Locale getLocale()
returns the locale associated with this holiday. If the return value is null, this holiday is considered to be globally valid


compareTo

public int compareTo(Holiday h)
based on the date

Specified by:
compareTo in interface Comparable<Holiday>

toString

public String toString()
returns the localized date along with the name

Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
based on both, name and date

Overrides:
equals in class Object


(c) 2001-2006 Holger Antelmann - all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads