class ManipulacaoDatasUtil {

	public static int getWeekDayAmountBetween(Date dateA, Date dateB, int dayOfWeek) {
		
		int result = 0;
		Calendar calA = null;
		Calendar calB = null;
		
		calA = getCalendar(dateA);
		calB = getCalendar(dateB);
		/*
		 * There is a LOT of cleverer ways to do this. But this one is kind of fun.
		 */
		for (; calA.before(calB); calA.add(Calendar.DAY_OF_YEAR, 1)) {
			if (calA.get(Calendar.DAY_OF_WEEK) == dayOfWeek) {
				result++;
			}
		}
		if (calB.get(Calendar.DAY_OF_WEEK) == dayOfWeek) {
			result++;
		}
		
		return result;		
	}

	private  ManipulacaoDatasUtil();

}