Package model.util
Class Date
java.lang.Object
model.util.Date
- All Implemented Interfaces:
Serializable
,Comparable<Date>
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Date
- Throws:
IllegalArgumentException
-
-
Method Details
-
getDay
public int getDay() -
getMonth
-
getYear
public int getYear() -
dateDifference
Computes the difference between 2 dates.- Parameters:
other
- other date- Returns:
- date difference
-
toString
-
equals
-
hashCode
public int hashCode() -
compareTo
Compares 2 dates- Specified by:
compareTo
in interfaceComparable<Date>
- Parameters:
d
- the object to be compared.- Returns:
- -1 -> passed date is bigger, 1 -> passed date smaller, 0 -> dates are equal
-
addDay
public void addDay(int daysPassed) Updates the date after adding the daysPassed.- Parameters:
daysPassed
- the days passed since last update
-