// Path: forgetIT/src/forgetit/common/Date.java
// @javax.persistence.Entity
// public class Date {
// 
// 	@Id
// 	@GeneratedValue
// 	private int id;
// 	int year;
// 	int month;
// 	int day;
// 	int hour;
// 	int minute;
// 
// 	@OneToOne(fetch = FetchType.LAZY)
// 	@JoinColumn(nullable = false)
// 	private forgetit.common.Entity entity_id;
// 
// 	public Date(int year, int month, int day, int hour, int minute) {
// 
// 		this.year = year;
// 		this.month = month + 1; // TODO check if this addition is ok
// 		this.day = day;
// 		this.hour = hour;
// 		this.minute = minute;
// 	}
// 
// 	public Date() {
// 
// 	}
// 
// 	@Override
// 	public String toString() {
// 
// 		return year + "-" + month + "-" + day + "-" + hour + ":" + minute;
// 	}
// 
// 	@Override
// 	public boolean equals(Object date) {
// 
// 		if (date instanceof Date) {
// 			boolean isEqual = true;
// 			Date compDate = (Date) date;
// 			if (this.year != compDate.getYear()) {
// 				isEqual = false;
// 			}
// 			if (this.month != compDate.getMonth()) {
// 				isEqual = false;
// 			}
// 			if (this.day != compDate.getDay()) {
// 				isEqual = false;
// 			}
// 			if (this.hour != compDate.getHour()) {
// 				isEqual = false;
// 			}
// 			if (this.minute != compDate.getMinute()) {
// 				isEqual = false;
// 			}
// 
// 			return isEqual;
// 		} else {
// 			return false;
// 		}
// 
// 	}
// 
// 	public int getYear() {
// 
// 		return year;
// 	}
// 
// 	public void setYear(int year) {
// 
// 		this.year = year;
// 	}
// 
// 	public int getMonth() {
// 
// 		return month;
// 	}
// 
// 	public void setMonth(int month) {
// 
// 		this.month = month;
// 	}
// 
// 	public int getDay() {
// 
// 		return day;
// 	}
// 
// 	public void setDay(int day) {
// 
// 		this.day = day;
// 	}
// 
// 	public int getHour() {
// 
// 		return hour;
// 	}
// 
// 	public void setHour(int hour) {
// 
// 		this.hour = hour;
// 	}
// 
// 	public int getMinute() {
// 
// 		return minute;
// 	}
// 
// 	public void setMinute(int minute) {
// 
// 		this.minute = minute;
// 	}
// 
// 	public void setId(int id) {
// 
// 		this.id = id;
// 	}
// 
// 	public int getId() {
// 
// 		return id;
// 	}
// 
// }
// 
// Path: forgetIT/src/forgetit/logic/interfaces/ICalendar.java
// public interface ICalendar {
// 	
// 	/**
// 	 * Checks if a given date is valid
// 	 * @param date the date to check
// 	 * @return true if valid
// 	 */
// 	public boolean checkDate(Date date);
// 	
// 	/**
// 	 * calculates the new date from a given date and a number of days
// 	 * @param days the days to add to the date
// 	 * @param date the date from which to start
// 	 * @return the new date
// 	 * @throws Exception if the given date isn't valid
// 	 */
// 	public Date addDays(int days, Date date) throws Exception;
// 	
// 	/**
// 	 * calculates the new date from a given date and a number of days
// 	 * @param days how many days before the given date
// 	 * @param date the date from which to start
// 	 * @return the new date
// 	 * @throws Exception if the given date isn't valid
// 	 */
// 	public Date subtractDays(int days, Date date) throws Exception;
// 
// 	/**
// 	 * 
// 	 * @return the date of today
// 	 */
// 	public Date today();
// 	
// 	/**
// 	 * converts String in Date 
// 	 * 
// 	 * possible strings are YYYY.MM.DD or DD.MM.YYYY
// 	 * chars between digits don't care
// 	 * 
// 	 * @param str the date as a String
// 	 * @return the date
// 	 * @throws IllegalArgumentException if the string is no date
// 	 * @throws NumberFormatException if the parts of the string are not convertable
// 	 */
// 	public Date convertStringToDate(String str) throws IllegalArgumentException, NumberFormatException;
// 	
// 	/**
// 	 * converts a Date to a String in US style
// 	 * @param date the date
// 	 * @return the date as string
// 	 */
// 	public String convertDateToStringInUSStyle(Date date);
// 	
// 	/**
// 	 * converts a Date to a String in german style
// 	 * @param date the date
// 	 * @return the date as string
// 	 */
// 	public String convertDateToStringInGermanStyle(Date date);
// }


import java.util.GregorianCalendar;
import java.util.TimeZone;
import forgetit.common.Date;
import forgetit.logic.interfaces.ICalendar;
/*
 * Copyright 2011 DHBW Stuttgart Campus Horb
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 
 * express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package forgetit.logic;



/**
 * Implementation of @see ICalendar
 * @author David Henn (<a href="mailto:[david.henn@gmail.com]">david.henn@gmail.com</a>)
 * @version 0.1
 */

public class Calendar implements ICalendar {
	@Override
// Path: forgetIT/src/forgetit/common/Date.java
// @javax.persistence.Entity
// public class Date {
// 
// 	@Id
// 	@GeneratedValue
// 	private int id;
// 	int year;
// 	int month;
// 	int day;
// 	int hour;
// 	int minute;
// 
// 	@OneToOne(fetch = FetchType.LAZY)
// 	@JoinColumn(nullable = false)
// 	private forgetit.common.Entity entity_id;
// 
// 	public Date(int year, int month, int day, int hour, int minute) {
// 
// 		this.year = year;
// 		this.month = month + 1; // TODO check if this addition is ok
// 		this.day = day;
// 		this.hour = hour;
// 		this.minute = minute;
// 	}
// 
// 	public Date() {
// 
// 	}
// 
// 	@Override
// 	public String toString() {
// 
// 		return year + "-" + month + "-" + day + "-" + hour + ":" + minute;
// 	}
// 
// 	@Override
// 	public boolean equals(Object date) {
// 
// 		if (date instanceof Date) {
// 			boolean isEqual = true;
// 			Date compDate = (Date) date;
// 			if (this.year != compDate.getYear()) {
// 				isEqual = false;
// 			}
// 			if (this.month != compDate.getMonth()) {
// 				isEqual = false;
// 			}
// 			if (this.day != compDate.getDay()) {
// 				isEqual = false;
// 			}
// 			if (this.hour != compDate.getHour()) {
// 				isEqual = false;
// 			}
// 			if (this.minute != compDate.getMinute()) {
// 				isEqual = false;
// 			}
// 
// 			return isEqual;
// 		} else {
// 			return false;
// 		}
// 
// 	}
// 
// 	public int getYear() {
// 
// 		return year;
// 	}
// 
// 	public void setYear(int year) {
// 
// 		this.year = year;
// 	}
// 
// 	public int getMonth() {
// 
// 		return month;
// 	}
// 
// 	public void setMonth(int month) {
// 
// 		this.month = month;
// 	}
// 
// 	public int getDay() {
// 
// 		return day;
// 	}
// 
// 	public void setDay(int day) {
// 
// 		this.day = day;
// 	}
// 
// 	public int getHour() {
// 
// 		return hour;
// 	}
// 
// 	public void setHour(int hour) {
// 
// 		this.hour = hour;
// 	}
// 
// 	public int getMinute() {
// 
// 		return minute;
// 	}
// 
// 	public void setMinute(int minute) {
// 
// 		this.minute = minute;
// 	}
// 
// 	public void setId(int id) {
// 
// 		this.id = id;
// 	}
// 
// 	public int getId() {
// 
// 		return id;
// 	}
// 
// }
// 
// Path: forgetIT/src/forgetit/logic/interfaces/ICalendar.java
// public interface ICalendar {
// 	
// 	/**
// 	 * Checks if a given date is valid
// 	 * @param date the date to check
// 	 * @return true if valid
// 	 */
// 	public boolean checkDate(Date date);
// 	
// 	/**
// 	 * calculates the new date from a given date and a number of days
// 	 * @param days the days to add to the date
// 	 * @param date the date from which to start
// 	 * @return the new date
// 	 * @throws Exception if the given date isn't valid
// 	 */
// 	public Date addDays(int days, Date date) throws Exception;
// 	
// 	/**
// 	 * calculates the new date from a given date and a number of days
// 	 * @param days how many days before the given date
// 	 * @param date the date from which to start
// 	 * @return the new date
// 	 * @throws Exception if the given date isn't valid
// 	 */
// 	public Date subtractDays(int days, Date date) throws Exception;
// 
// 	/**
// 	 * 
// 	 * @return the date of today
// 	 */
// 	public Date today();
// 	
// 	/**
// 	 * converts String in Date 
// 	 * 
// 	 * possible strings are YYYY.MM.DD or DD.MM.YYYY
// 	 * chars between digits don't care
// 	 * 
// 	 * @param str the date as a String
// 	 * @return the date
// 	 * @throws IllegalArgumentException if the string is no date
// 	 * @throws NumberFormatException if the parts of the string are not convertable
// 	 */
// 	public Date convertStringToDate(String str) throws IllegalArgumentException, NumberFormatException;
// 	
// 	/**
// 	 * converts a Date to a String in US style
// 	 * @param date the date
// 	 * @return the date as string
// 	 */
// 	public String convertDateToStringInUSStyle(Date date);
// 	
// 	/**
// 	 * converts a Date to a String in german style
// 	 * @param date the date
// 	 * @return the date as string
// 	 */
// 	public String convertDateToStringInGermanStyle(Date date);
// }


// Path: forgetIT/src/forgetit/logic/Calendar.java
import java.util.GregorianCalendar;
import java.util.TimeZone;
import forgetit.common.Date;
import forgetit.logic.interfaces.ICalendar;

/*
 * Copyright 2011 DHBW Stuttgart Campus Horb
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 
 * express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package forgetit.logic;



/**
 * Implementation of @see ICalendar
 * @author David Henn (<a href="mailto:[david.henn@gmail.com]">david.henn@gmail.com</a>)
 * @version 0.1
 */

public class Calendar implements ICalendar {
	@Override
	public boolean checkDate(Date date) {