Here you can find the source of calendarDayToOrdinalDay(int dow)
public static int calendarDayToOrdinalDay(int dow)
//package com.java2s; import java.util.Calendar; public class Main { public static int calendarDayToOrdinalDay(int dow) { return dow == Calendar.MONDAY ? 1 : dow == Calendar.TUESDAY ? 2 : dow == Calendar.WEDNESDAY ? 3 : dow == Calendar.THURSDAY ? 4 : dow == Calendar.FRIDAY ? 5 : dow == Calendar.SATURDAY ? 6 : 7; }/* w w w .ja va2s . co m*/ }