shared
Class CalendarEvent

java.lang.Object
  extended byshared.CalendarEvent
All Implemented Interfaces:
java.io.Serializable

public class CalendarEvent
extends java.lang.Object
implements java.io.Serializable

This class specifies calendar events. Calendar event objects are the most used objects of the whole netcalendar suite.

Author:
buetow
See Also:
Serialized Form

Constructor Summary
CalendarEvent(CalendarCategory category)
          Simple constructor, creates an event object and increments iEventIDCount by one.
CalendarEvent(java.lang.String sCategoryName)
          Simple constructor, creates an event object and increments iEventIDCount by one.
 
Method Summary
 CalendarCategory getCategory()
          This event returns the event's calendar category.
 java.lang.String getCategoryName()
          This method returns the event's category name.
 MyDate getDate()
          This method returns the event's date object.
 java.lang.String getDescription()
          This method returns the event's description string.
 int getEventID()
          This method returns the event's ID number.
 java.lang.String getPlace()
          This method returns the event's place string.
 boolean isYearly()
          This method checks if this event occurs yearly or not.
 boolean matches(java.util.regex.Pattern pattern)
          Checks if the current event matches all available data of the event agains a given regular expression pattern.
 boolean matchesCategory(java.util.regex.Pattern pattern)
          Checks if the current event's category name matches agains a regular expression pattern
 boolean matchesCategoryName(java.util.regex.Pattern pattern)
          Checks if the current event's name matches agains a regular expression pattern.
 boolean matchesDateString(java.util.regex.Pattern pattern)
          Checks if the current event's date string matches agains a regular expression pattern
 boolean matchesDescription(java.util.regex.Pattern pattern)
          Checks if the current event's description string matches agains a regular expression pattern.
 boolean matchesPlace(java.util.regex.Pattern pattern)
          Checks if the current event's place string matches agains a regular expression pattern.
 void removeFromCurrentCategory()
          Removes the calendar event from its current category and sets the category reference to null.
 void setCategory(CalendarCategory category)
          This method sets the event's category.
 void setCategoryName(java.lang.String sCategoryName)
          This methos sets thhe event's category name.
 void setDate(java.util.Date date)
          This method sets the event's date.
 void setDescription(java.lang.String sDescription)
          This method sets the event's descriptions tring.
 void setEventID(int iEventID)
          This method sets the event's ID number.
 void setPlace(java.lang.String sPlace)
          This method sets the event's place string.
 void setYearly(boolean bYearly)
          This method specifies if this event occurs yearly or not.
 java.lang.String toString()
          This method is needed for a text representation of the object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CalendarEvent

public CalendarEvent(CalendarCategory category)
Simple constructor, creates an event object and increments iEventIDCount by one.

Parameters:
category - Specifies the event's category.

CalendarEvent

public CalendarEvent(java.lang.String sCategoryName)
Simple constructor, creates an event object and increments iEventIDCount by one.

Parameters:
sCategoryName - Specifies the event's category name.
Method Detail

setDate

public void setDate(java.util.Date date)
This method sets the event's date.

Parameters:
date - Specifies the event's date.

setCategory

public void setCategory(CalendarCategory category)
This method sets the event's category.

Parameters:
category - Specifies the event's category.

getCategory

public CalendarCategory getCategory()
This event returns the event's calendar category.

Returns:
Returns the event's calenda category.

setCategoryName

public void setCategoryName(java.lang.String sCategoryName)
This methos sets thhe event's category name.

Parameters:
sCategoryName - Specifies the event's category name.

setDescription

public void setDescription(java.lang.String sDescription)
This method sets the event's descriptions tring.

Parameters:
sDescription - Specifies the event's description string.

setPlace

public void setPlace(java.lang.String sPlace)
This method sets the event's place string.

Parameters:
sPlace - Specifies the event's place string.

setEventID

public void setEventID(int iEventID)
This method sets the event's ID number.

Parameters:
iEventID - specifies the event's ID number.

setYearly

public void setYearly(boolean bYearly)
This method specifies if this event occurs yearly or not.

Parameters:
bYearly - Specifies if this event occury yearly or not.

getCategoryName

public java.lang.String getCategoryName()
This method returns the event's category name.

Returns:
Returns the event's category name.

getDescription

public java.lang.String getDescription()
This method returns the event's description string.

Returns:
Returns the event's description string.

getPlace

public java.lang.String getPlace()
This method returns the event's place string.

Returns:
Returns the event's place string.

getDate

public MyDate getDate()
This method returns the event's date object.

Returns:
Returns the event's date object.

getEventID

public int getEventID()
This method returns the event's ID number.

Returns:
Returns the event's ID number.

isYearly

public boolean isYearly()
This method checks if this event occurs yearly or not.

Returns:
Returns true if the event occurs yearly, else it returns false.

matches

public boolean matches(java.util.regex.Pattern pattern)
Checks if the current event matches all available data of the event agains a given regular expression pattern.

Parameters:
pattern - Specifies the pattern to match against.
Returns:
Returns true if one element of the event matches.

matchesCategoryName

public boolean matchesCategoryName(java.util.regex.Pattern pattern)
Checks if the current event's name matches agains a regular expression pattern.

Parameters:
pattern - Specifies the pattern to be matched against.
Returns:
Returns true if the event matches, else false will be returned. If the pattern is null, true will be returned.

matchesDescription

public boolean matchesDescription(java.util.regex.Pattern pattern)
Checks if the current event's description string matches agains a regular expression pattern.

Parameters:
pattern - Specifies the pattern to match against.
Returns:
Returns true if the event matches, else false will be returned. If the pattern is null, true will be returned.

matchesPlace

public boolean matchesPlace(java.util.regex.Pattern pattern)
Checks if the current event's place string matches agains a regular expression pattern.

Parameters:
pattern - Specifies the pattern to match against.
Returns:
Returns true if the event matches, else false will be returned. If the pattern is null, true will be returned.

matchesCategory

public boolean matchesCategory(java.util.regex.Pattern pattern)
Checks if the current event's category name matches agains a regular expression pattern

Parameters:
pattern - Specifies the pattern to match against.
Returns:
Returns true if the event matches, else false will be returned. If the pattern is null, true will be returned.

matchesDateString

public boolean matchesDateString(java.util.regex.Pattern pattern)
Checks if the current event's date string matches agains a regular expression pattern

Parameters:
pattern - Specifies the pattern to match against.
Returns:
Returns true if the event matches, else false will be returned. If the pattern is null, true will be returned.

removeFromCurrentCategory

public void removeFromCurrentCategory()
Removes the calendar event from its current category and sets the category reference to null.


toString

public java.lang.String toString()
This method is needed for a text representation of the object.

Returns:
Returns object represented as a String.