当前位置: 首页>>代码示例>>Java>>正文


Java Calendar.MONDAY属性代码示例

本文整理汇总了Java中java.util.Calendar.MONDAY属性的典型用法代码示例。如果您正苦于以下问题:Java Calendar.MONDAY属性的具体用法?Java Calendar.MONDAY怎么用?Java Calendar.MONDAY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在java.util.Calendar的用法示例。


在下文中一共展示了Calendar.MONDAY属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setWkday

/**
 * Set the wkday member
 * @param w String to set
 * @throws IllegalArgumentException if w is not a valid day.
 */
public void setWkday(String w) throws IllegalArgumentException {
    sipWkDay = w;
    if (sipWkDay.compareToIgnoreCase(MON) == 0) {
        wkday = Calendar.MONDAY;
    } else if (sipWkDay.compareToIgnoreCase(TUE) == 0) {
        wkday = Calendar.TUESDAY;
    } else if (sipWkDay.compareToIgnoreCase(WED) == 0) {
        wkday = Calendar.WEDNESDAY;
    } else if (sipWkDay.compareToIgnoreCase(THU) == 0) {
        wkday = Calendar.THURSDAY;
    } else if (sipWkDay.compareToIgnoreCase(FRI) == 0) {
        wkday = Calendar.FRIDAY;
    } else if (sipWkDay.compareToIgnoreCase(SAT) == 0) {
        wkday = Calendar.SATURDAY;
    } else if (sipWkDay.compareToIgnoreCase(SUN) == 0) {
        wkday = Calendar.SUNDAY;
    } else {
        throw new IllegalArgumentException("Illegal Week day :" + w);
    }
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:25,代码来源:SIPDate.java

示例2: getWeek

public static String getWeek(Calendar calendar) {
    String[] week = AmenEyeApplication.getContext().getResources().getStringArray(R.array.week_array);
    int day = calendar.get(Calendar.DAY_OF_WEEK);
    switch (day) {
        case Calendar.MONDAY:
            return week[0];
        case Calendar.TUESDAY:
            return week[1];
        case Calendar.WEDNESDAY:
            return week[2];
        case Calendar.THURSDAY:
            return week[3];
        case Calendar.FRIDAY:
            return week[4];
        case Calendar.SATURDAY:
            return week[5];
        case Calendar.SUNDAY:
            return week[6];
        default:
            return null;
    }
}
 
开发者ID:haihaio,项目名称:AmenEye,代码行数:22,代码来源:DateUtil.java

示例3: getDayOfWeeekId

private int getDayOfWeeekId(String csDayValue)
{
	csDayValue = csDayValue.toUpperCase();
	if(csDayValue.startsWith("MON"))
		return Calendar.MONDAY;
	else if(csDayValue.startsWith("TUE"))
		return Calendar.TUESDAY;
	else if(csDayValue.startsWith("WED"))
		return Calendar.WEDNESDAY;
	else if(csDayValue.startsWith("THU"))
		return Calendar.THURSDAY;
	else if(csDayValue.startsWith("FRI"))
		return Calendar.FRIDAY;
	else if(csDayValue.startsWith("SAT"))
		return Calendar.SATURDAY;
	return Calendar.SUNDAY;
}
 
开发者ID:costea7,项目名称:ChronoBike,代码行数:17,代码来源:OpenCalendar.java

示例4: formateDay

public static String formateDay(Context context,int dayOfWeak){
    switch (dayOfWeak){
        case Calendar.SUNDAY:
        default:
            return  context.getString(R.string.datescroller_sunday);
        case Calendar.MONDAY:
            return context.getString(R.string.datescroller_monday);
        case Calendar.TUESDAY:
            return context.getString(R.string.datescroller_tuseday);
        case Calendar.WEDNESDAY:
            return context.getString(R.string.datescroller_wednesday);
        case Calendar.THURSDAY:
            return context.getString(R.string.datescroller_thursday);
        case Calendar.FRIDAY:
            return context.getString(R.string.datescroller_friday);
        case Calendar.SATURDAY:
            return context.getString(R.string.datescroller_saturday);
    }
}
 
开发者ID:arjinmc,项目名称:DateScroller,代码行数:19,代码来源:DateScrollerUitls.java

示例5: nbrMeetings

protected int nbrMeetings(DatePattern datePattern, int dayCode) {
	if (datePattern == null) return 0;
	Calendar cal = Calendar.getInstance(Locale.US);
	cal.setTime(datePattern.getStartDate()); cal.setLenient(true);
       String pattern = datePattern.getPattern();
       int ret = 0;
       for (int idx = 0; idx < pattern.length(); idx++) {
       	if (pattern.charAt(idx) == '1') {
       		boolean offered = false;
       		switch (cal.get(Calendar.DAY_OF_WEEK)) {
       			case Calendar.MONDAY : offered = ((dayCode & Constants.DAY_CODES[Constants.DAY_MON]) != 0); break;
       			case Calendar.TUESDAY : offered = ((dayCode & Constants.DAY_CODES[Constants.DAY_TUE]) != 0); break;
       			case Calendar.WEDNESDAY : offered = ((dayCode & Constants.DAY_CODES[Constants.DAY_WED]) != 0); break;
       			case Calendar.THURSDAY : offered = ((dayCode & Constants.DAY_CODES[Constants.DAY_THU]) != 0); break;
       			case Calendar.FRIDAY : offered = ((dayCode & Constants.DAY_CODES[Constants.DAY_FRI]) != 0); break;
       			case Calendar.SATURDAY : offered = ((dayCode & Constants.DAY_CODES[Constants.DAY_SAT]) != 0); break;
       			case Calendar.SUNDAY : offered = ((dayCode & Constants.DAY_CODES[Constants.DAY_SUN]) != 0); break;
       		}
       		if (offered) ret++;
       	}
       	cal.add(Calendar.DAY_OF_YEAR, 1);
       }
       return ret;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:24,代码来源:MeetingCountingDuration.java

示例6: getDayOfWeek

public static int getDayOfWeek(Date date) {
  	Calendar c = Calendar.getInstance(Locale.US);
  	c.setTime(date);
switch (c.get(Calendar.DAY_OF_WEEK)) {
case Calendar.MONDAY:
	return DAY_MON;
case Calendar.TUESDAY:
	return DAY_TUE;
case Calendar.WEDNESDAY:
	return DAY_WED;
case Calendar.THURSDAY:
	return DAY_THU;
case Calendar.FRIDAY:
	return DAY_FRI;
case Calendar.SATURDAY:
	return DAY_SAT;
case Calendar.SUNDAY:
	return DAY_SUN;
default:
	return DAY_MON;
}
  }
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:22,代码来源:Constants.java

示例7: dayOfWeekConv

private static int dayOfWeekConv(int fieldVal) {
    switch (fieldVal) {
    case Calendar.SUNDAY:
        return 6;
    case Calendar.MONDAY:
        return 0;
    case Calendar.TUESDAY:
        return 1;
    case Calendar.WEDNESDAY:
        return 2;
    case Calendar.THURSDAY:
        return 3;
    case Calendar.FRIDAY:
        return 4;
    case Calendar.SATURDAY:
        return 5;
    }
    return -1;
}
 
开发者ID:mob41,项目名称:broadlink-java-api,代码行数:19,代码来源:DiscoveryPacket.java

示例8: getDaysCode

public int getDaysCode(Set meetings) {
    int daysCode = 0;
    for (Iterator i=meetings.iterator();i.hasNext();) {
        Meeting meeting = (Meeting)i.next();
        Calendar date = Calendar.getInstance(Locale.US);
        date.setTime(meeting.getMeetingDate());
        switch (date.get(Calendar.DAY_OF_WEEK)) {
        case Calendar.MONDAY : daysCode |= Constants.DAY_CODES[Constants.DAY_MON]; break;
        case Calendar.TUESDAY : daysCode |= Constants.DAY_CODES[Constants.DAY_TUE]; break;
        case Calendar.WEDNESDAY : daysCode |= Constants.DAY_CODES[Constants.DAY_WED]; break;
        case Calendar.THURSDAY : daysCode |= Constants.DAY_CODES[Constants.DAY_THU]; break;
        case Calendar.FRIDAY : daysCode |= Constants.DAY_CODES[Constants.DAY_FRI]; break;
        case Calendar.SATURDAY : daysCode |= Constants.DAY_CODES[Constants.DAY_SAT]; break;
        case Calendar.SUNDAY : daysCode |= Constants.DAY_CODES[Constants.DAY_SUN]; break;
        }
    }
    return daysCode;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:18,代码来源:ClassesAction.java

示例9: getDayOfWeekCode

/**
 * Convert a {@link Calendar} weekday value to the corresponding
 * Bluetooth weekday code.
 */
private static byte getDayOfWeekCode(int dayOfWeek) {
    switch (dayOfWeek) {
        case Calendar.MONDAY:
            return DAY_MONDAY;
        case Calendar.TUESDAY:
            return DAY_TUESDAY;
        case Calendar.WEDNESDAY:
            return DAY_WEDNESDAY;
        case Calendar.THURSDAY:
            return DAY_THURSDAY;
        case Calendar.FRIDAY:
            return DAY_FRIDAY;
        case Calendar.SATURDAY:
            return DAY_SATURDAY;
        case Calendar.SUNDAY:
            return DAY_SUNDAY;
        default:
            return DAY_UNKNOWN;
    }
}
 
开发者ID:androidthings,项目名称:sample-bluetooth-le-gattserver,代码行数:24,代码来源:TimeProfile.java

示例10: getDaysCode

public int getDaysCode(Event event) {
    int daysCode = 0;
    for (Iterator i=event.getMeetings().iterator();i.hasNext();) {
        Meeting meeting = (Meeting)i.next();
        Calendar date = Calendar.getInstance(Locale.US);
        date.setTime(meeting.getMeetingDate());
        switch (date.get(Calendar.DAY_OF_WEEK)) {
        case Calendar.MONDAY : daysCode |= Constants.DAY_CODES[Constants.DAY_MON]; break;
        case Calendar.TUESDAY : daysCode |= Constants.DAY_CODES[Constants.DAY_TUE]; break;
        case Calendar.WEDNESDAY : daysCode |= Constants.DAY_CODES[Constants.DAY_WED]; break;
        case Calendar.THURSDAY : daysCode |= Constants.DAY_CODES[Constants.DAY_THU]; break;
        case Calendar.FRIDAY : daysCode |= Constants.DAY_CODES[Constants.DAY_FRI]; break;
        case Calendar.SATURDAY : daysCode |= Constants.DAY_CODES[Constants.DAY_SAT]; break;
        case Calendar.SUNDAY : daysCode |= Constants.DAY_CODES[Constants.DAY_SUN]; break;
        }
    }
    return daysCode;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:18,代码来源:MakeAssignmentsForClassEvents.java

示例11: updateWeekdayArray

private void updateWeekdayArray(int day) {
    Locale chineseLocale = new Locale("zh");
    Locale currentLocale = Locale.getDefault();
    boolean isChineseUser = currentLocale.getLanguage().equals(chineseLocale.getLanguage());
    Resources resources = getContext().getResources();
    
    if (isChineseUser) {
        if (day == Calendar.MONDAY) {
            mWeekdayName = resources.getStringArray(R.array.monday_first_chinese_weekday_name);
        } else if (day == Calendar.SUNDAY) {
            mWeekdayName = resources.getStringArray(R.array.sunday_first_chinese_weekday_name);
        }
    } else {
        if (day == Calendar.MONDAY) {
            mWeekdayName = resources.getStringArray(R.array.monday_first_english_weekday_name);
        } else if (day == Calendar.SUNDAY) {
            mWeekdayName = resources.getStringArray(R.array.sunday_first_english_weekday_name);
        }
    }
}
 
开发者ID:nichbar,项目名称:MonthView,代码行数:20,代码来源:MonthView.java

示例12: firstDate

protected static Date firstDate(DatePattern dp, int dayCode) {
   	if (dp == null) return null;
   	BitSet weekCode = dp.getPatternBitSet();
   	if (weekCode.isEmpty()) return null;
   	Calendar cal = Calendar.getInstance(Locale.US); cal.setLenient(true);
   	Date dpFirstDate = DateUtils.getDate(1, dp.getSession().getPatternStartMonth(), dp.getSession().getSessionStartYear());
   	cal.setTime(dpFirstDate);
   	int idx = weekCode.nextSetBit(0);
   	cal.add(Calendar.DAY_OF_YEAR, idx);
   	while (idx < weekCode.size()) {
   		if (weekCode.get(idx)) {
       		int dow = cal.get(Calendar.DAY_OF_WEEK);
       		switch (dow) {
       		case Calendar.MONDAY:
       			if ((dayCode & DayCode.MON.getCode()) != 0) return cal.getTime();
       			break;
       		case Calendar.TUESDAY:
       			if ((dayCode & DayCode.TUE.getCode()) != 0) return cal.getTime();
       			break;
       		case Calendar.WEDNESDAY:
       			if ((dayCode & DayCode.WED.getCode()) != 0) return cal.getTime();
       			break;
       		case Calendar.THURSDAY:
       			if ((dayCode & DayCode.THU.getCode()) != 0) return cal.getTime();
       			break;
       		case Calendar.FRIDAY:
       			if ((dayCode & DayCode.FRI.getCode()) != 0) return cal.getTime();
       			break;
       		case Calendar.SATURDAY:
       			if ((dayCode & DayCode.SAT.getCode()) != 0) return cal.getTime();
       			break;
       		case Calendar.SUNDAY:
       			if ((dayCode & DayCode.SUN.getCode()) != 0) return cal.getTime();
       			break;
       		}
       	}
   		cal.add(Calendar.DAY_OF_YEAR, 1); idx++;
   	}
   	return null;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:40,代码来源:ClassInfoConnector.java

示例13: getDayOfWeek

public static DataClass getDayOfWeek(LinkedList<DataClass> listParams) throws JFCALCExpErrException {
    if (listParams.size() != 1)   {
        throw new JFCALCExpErrException(ERRORTYPES.ERROR_INCORRECT_NUM_OF_PARAMETER);
    }
    DataClass datumTS = new DataClass();
    datumTS.copyTypeValueDeep(listParams.removeLast());
    datumTS.changeDataType(DATATYPES.DATUM_INTEGER);
    long lTS = datumTS.getDataValue().longValue();
    Calendar cal = Calendar.getInstance();
    cal.setTimeInMillis(lTS);
    int nReturn = cal.get(Calendar.DAY_OF_WEEK);
    int nDayOfWeek = 0;
    switch (nReturn) {
        case (Calendar.SUNDAY): {
            nDayOfWeek = 0;
            break;
        } case (Calendar.MONDAY): {
            nDayOfWeek = 1;
            break;
        } case (Calendar.TUESDAY): {
            nDayOfWeek = 2;
            break;
        } case (Calendar.WEDNESDAY): {
            nDayOfWeek = 3;
            break;
        } case (Calendar.THURSDAY): {
            nDayOfWeek = 4;
            break;
        } case (Calendar.FRIDAY): {
            nDayOfWeek = 5;
            break;
        } case (Calendar.SATURDAY): {
            nDayOfWeek = 6;
            break;
        }
    }
    return new DataClass(DATATYPES.DATUM_INTEGER, new MFPNumeric(nDayOfWeek));
}
 
开发者ID:woshiwpa,项目名称:SmartMath,代码行数:38,代码来源:MFPDateTime.java

示例14: main

public static void main(String[] args) {
    Calendar huCalendar = Calendar.getInstance(new Locale("hu","HU"));
    int hufirstDayOfWeek = huCalendar.getFirstDayOfWeek();
    if (hufirstDayOfWeek != Calendar.MONDAY) {
        throw new RuntimeException();
    }

    Calendar ukCalendar = Calendar.getInstance(new Locale("uk","UA"));
    int ukfirstDayOfWeek = ukCalendar.getFirstDayOfWeek();
    if (ukfirstDayOfWeek != Calendar.MONDAY) {
        throw new RuntimeException();
    }

}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:14,代码来源:Bug4527203.java

示例15: setToday

private void setToday() {
    Calendar calendar = Calendar.getInstance();
    int date = calendar.get(Calendar.DAY_OF_WEEK);

    switch (date) {
        case Calendar.MONDAY:
            dayMonday.setSelected(true);
            break;
        case Calendar.TUESDAY:
            dayTuesday.setSelected(true);
            break;
        case Calendar.WEDNESDAY:
            dayWednesday.setSelected(true);
            break;
        case Calendar.THURSDAY:
            dayThursday.setSelected(true);
            break;
        case Calendar.FRIDAY:
            dayFriday.setSelected(true);
            break;
        case Calendar.SATURDAY:
            daySaturday.setSelected(true);
            break;
        case Calendar.SUNDAY:
            daySunday.setSelected(true);
            break;
    }

}
 
开发者ID:PacktPublishing,项目名称:Expert-Android-Programming,代码行数:29,代码来源:PlaceDetailActivity.java


注:本文中的java.util.Calendar.MONDAY属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。