package domainobjects;

import java.util.Calendar;

public class SimpleDate implements Comparable<SimpleDate>
{
	private SimpleDate()
	{
		date = Calendar.getInstance();
	}
	
	public int getYear()
	{
		return date.get(Calendar.YEAR);
	}
	
	public int getMonth()
	{
		return date.get(Calendar.MONTH);
	}
	
	public int getDay()
	{
		return date.get(Calendar.DAY_OF_MONTH);
	}
	
	public void setYear(int inYear)
	{
		date.set(Calendar.YEAR, inYear);
	}
	
	public void setMonth(int inMonth)
	{
		date.set(Calendar.MONTH, inMonth);
	}
	
	public void setDay(int inDay)
	{
		date.set(Calendar.DAY_OF_MONTH, inDay);
	}
	
	@Override
	public String toString()
	{
		return String.format("%02d/%02d/%04d", getMonth(), getDay(), getYear());
	}
	
	@Override
	public int compareTo(SimpleDate o) 
	{
		return date.compareTo(o.date);
	}
	
	private Calendar date;
	
	public static SimpleDate Now()
	{
		return new SimpleDate();
	}
	
	public enum Month
	{
		JANUARY,
		FEBRURARY,
		MARCH,
		APRIL,
		MAY,
		JUNE,
		JULY,
		AUGUST,
		SEPTEMBER,
		OCTOBER,
		NOVEMEBER,
		DECEMBER
	}
}

@@ -160,32 +160,281 @@
 nstance();%0A%09%7D%0A%09%0A
+%09public void setDate(String inDate)%0A%09%7B%0A%09%09final String temp%5B%5D = inDate.split(%22/%22);%0A%0A%09%09if(temp.length==3)%0A%09%09%7B%0A%09%09%09this.setDay(Integer.parseInt(temp%5B0%5D));%0A%09%09%09this.setMonth(Integer.parseInt(temp%5B1%5D));%0A%09%09%09this.setYear(Integer.parseInt(temp%5B2%5D));%0A%09%09%7D%0A%09%7D%0A%09%0A
 %09public int getY
@@ -860,47 +860,162 @@
 %0A%09%0A%09
-@Override%0A%09public String toString()%0A
+public int compareTo(SimpleDate inDate)%0A%09%7B%0A%09%09if(this.getYear() %3E inDate.getYear())%0A%09%09%7B%0A%09%09%09return 1;%0A%09%09%7D%0A%09%09else if(this.getYear() %3C inDate.getYear())%0A%09
 %09%7B%0A
+%09
 %09%09re
@@ -1023,160 +1023,741 @@
 urn 
-String.format(%22%2502d/%2502d/%2504d%22, getMonth(), getDay(), getYear())
+-1;%0A%09%09%7D%0A%09%09%0A%09%09if(this.getMonth() %3E inDate.getMonth())%0A%09%09%7B%0A%09%09%09return 1;%0A%09%09%7D%0A%09%09else if(this.getMonth() %3C inDate.getMonth())%0A%09%09%7B%0A%09%09%09return -1;%0A%09%09%7D%0A%09%09%0A%09%09if(this.getDay() %3E inDate.getDay())%0A%09%09%7B%0A%09%09%09return 1
 ;%0A
+%09
 %09%7D%0A%09
-%0A%09@Override%0A%09public int compareTo(SimpleDate o) %0A%09%7B%0A%09%09return date.compareTo(o.date
+%09else if(this.getDay() %3C inDate.getDay())%0A%09%09%7B%0A%09%09%09return -1;%0A%09%09%7D%0A%09%09%0A%09%09return 0;%0A%09%7D%0A%09%0A%09public boolean equals(Object inObject)%0A%09%7B%0A%09%09if(inObject ==null)%0A%09%09%7B%0A%09%09%09return false;%0A%09%09%7D%0A%09%09%0A%09%09if(!(inObject instanceof SimpleDate))%0A%09%09%7B%0A%09%09%09return false;%0A%09%09%7D%0A%09%09%0A%09%09SimpleDate inDate = (SimpleDate)inObject;%0A%09%09return this.getDay() == inDate.getDay() && this.getMonth() == inDate.getMonth() && this.getYear() == inDate.getYear();%0A%09%7D%0A%09%0A%09@Override%0A%09public String toString()%0A%09%7B%0A%09%09return String.format(%22%2502d/%2502d/%2504d%22, getDay(), getMonth(), getYear()
 );%0A%09

Update SimpleDate.java