int day = (int) (getLinearTime(year, dayOfYear, 0) / (24 * 60 * 60 * 1000L));
boolean greg = isGregorian(year, dayOfYear); int day = (int) getLinearDay(year, dayOfYear, greg);
  private int getWeekDay(int year, int dayOfYear)  {    int day = (int) (getLinearTime(year, dayOfYear, 0) / (24 * 60 * 60 * 1000L));		// The epoch was a thursday.		int weekday = (day + THURSDAY) % 7;		if (weekday <= 0)			weekday += 7;		return weekday;	}