Here you can find the source of getDateOfWeek(int year, int weekOfYear, int i)
public static Date getDateOfWeek(int year, int weekOfYear, int i)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static int FIRST_DAY_OF_WEEK = Calendar.MONDAY; public static Date getDateOfWeek(int year, int weekOfYear, int i) { Calendar day = getCalendar(); day.set(Calendar.YEAR, year); day.set(Calendar.WEEK_OF_YEAR, weekOfYear + 1); day.setFirstDayOfWeek(FIRST_DAY_OF_WEEK); switch (i) { case 0:/*www . j a v a2 s . c om*/ day.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY); break; case 1: day.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY); break; case 2: day.set(Calendar.DAY_OF_WEEK, Calendar.WEDNESDAY); break; case 3: day.set(Calendar.DAY_OF_WEEK, Calendar.THURSDAY); break; case 4: day.set(Calendar.DAY_OF_WEEK, Calendar.FRIDAY); break; case 5: day.set(Calendar.DAY_OF_WEEK, Calendar.SATURDAY); break; case 6: day.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY); break; } return day.getTime(); } private static Calendar getCalendar() { Calendar c = Calendar.getInstance(); c.setFirstDayOfWeek(FIRST_DAY_OF_WEEK); return c; } }