monthlyCalendar
Class Date

java.lang.Object
  extended by monthlyCalendar.Date

public class Date
extends java.lang.Object

This class represents a date (day and number). We have implemented this class for you and you should not modify it.

Author:
Dept of Computer Science, UMCP

Constructor Summary
Date(Day day, int dayNumber)
          Initializes a date object.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares two date objects.
 Day getDay()
          Returns the day value.
 int getNumber()
          Returns the number associated with the date.
 int hashCode()
          Returns a hash code for the object based on the string representation for the object.
 java.lang.String toString()
          Returns a string representation for a date, with the day followed by the number.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Date

public Date(Day day,
            int dayNumber)
Initializes a date object.

Parameters:
day -
dayNumber -
Method Detail

toString

public java.lang.String toString()
Returns a string representation for a date, with the day followed by the number.

Overrides:
toString in class java.lang.Object
Returns:
string representation for a date

getDay

public Day getDay()
Returns the day value.

Returns:
day

getNumber

public int getNumber()
Returns the number associated with the date.

Returns:
number

equals

public boolean equals(java.lang.Object obj)
Compares two date objects. Two date objects are considered equal if they have the same day and number, respectively.

Overrides:
equals in class java.lang.Object
Returns:
true if the objects are considered equal and false otherwise

hashCode

public int hashCode()
Returns a hash code for the object based on the string representation for the object.

Overrides:
hashCode in class java.lang.Object
Returns:
hash code value


Web Accessibility