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


Java Calendar.TUESDAY属性代码示例

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


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

示例1: WeekDayStr

public String WeekDayStr()
{
    cld.setTime(_date);
        switch (cld.get(Calendar.DAY_OF_WEEK))
        {
            case Calendar.SUNDAY:
                return "星期日";
            case Calendar.MONDAY:
                return "星期一";
            case Calendar.TUESDAY:
                return "星期二";
            case Calendar.WEDNESDAY:
                return "星期三";
            case Calendar.THURSDAY:
                return "星期四";
            case Calendar.FRIDAY:
                return "星期五";
            default:
                return "星期六";
        }

}
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:22,代码来源:ChineseCalendar.java

示例2: currentDayOfWeek

/**
 * Utility method to return a current day of the week that can be used in the Count.ly API.
 */
static int currentDayOfWeek(){
    int day = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
    switch (day) {
        case Calendar.MONDAY:
            return 1;
        case Calendar.TUESDAY:
            return 2;
        case Calendar.WEDNESDAY:
            return 3;
        case Calendar.THURSDAY:
            return 4;
        case Calendar.FRIDAY:
            return 5;
        case Calendar.SATURDAY:
            return 6;
    }
    return 0;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:21,代码来源:Countly.java

示例3: getNextDayOfWeek

private int getNextDayOfWeek() {
    Calendar c = new GregorianCalendar();
    c.setTime(new Date());
    int i = c.get(Calendar.DAY_OF_WEEK);
    if (i == Calendar.SUNDAY)
        return 1;
    if (i == Calendar.MONDAY)
        return 2;
    if (i == Calendar.TUESDAY)
        return 3;
    if (i == Calendar.WEDNESDAY)
        return 4;
    if (i == Calendar.THURSDAY)
        return 5;
    return 6;
}
 
开发者ID:LCA311,项目名称:leoapp-sources,代码行数:16,代码来源:NotificationHandler.java

示例4: 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,代码来源:PersonalizedExamReportAction.java

示例5: getDay

private int getDay(int day) {
    switch (day) {
        case Calendar.SUNDAY:
            return 0;
        case Calendar.MONDAY:
            return 1;
        case Calendar.TUESDAY:
            return 2;
        case Calendar.WEDNESDAY:
            return 3;
        case Calendar.THURSDAY:
            return 4;
        case Calendar.FRIDAY:
            return 5;
        case Calendar.SATURDAY:
            return 6;
        default:
            return 0;
    }
}
 
开发者ID:riteshakya037,项目名称:Android-Scrapper,代码行数:20,代码来源:GridCalendarAdapter.java

示例6: calculateFee

/**
 * For characters below level 77 teleport service is free.<br>
 * From 8.00 pm to 00.00 from Monday till Tuesday for all characters there's a 50% discount on teleportation services
 * @param player
 * @param type
 * @param loc
 * @return
 */
private long calculateFee(L2PcInstance player, TeleportType type, TeleportLocation loc)
{
	if (type == TeleportType.NORMAL)
	{
		if (!player.isSubClassActive() && (player.getLevel() < 77))
		{
			return 0;
		}
		
		final Calendar cal = Calendar.getInstance();
		final int hour = cal.get(Calendar.HOUR_OF_DAY);
		final int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);
		if ((hour >= 20) && ((dayOfWeek >= Calendar.MONDAY) && (dayOfWeek <= Calendar.TUESDAY)))
		{
			return loc.getFeeCount() / 2;
		}
	}
	return loc.getFeeCount();
}
 
开发者ID:rubenswagner,项目名称:L2J-Global,代码行数:27,代码来源:L2TeleporterInstance.java

示例7: setCurrentClock

void setCurrentClock() {
    ChipRobot robot = ChipRobotFinder.getInstance().getChipRobotConnectedList().get(0);

    Calendar rightNow = Calendar.getInstance();
    final int year = rightNow.get(Calendar.YEAR);
    final int month = rightNow.get(Calendar.MONTH);
    final int day = rightNow.get(Calendar.DATE);
    final int hour = rightNow.get(Calendar.HOUR_OF_DAY);
    final int minute = rightNow.get(Calendar.MINUTE);
    final int seconds = rightNow.get(Calendar.SECOND);
    int dayOfWeek_t = rightNow.get(Calendar.DAY_OF_WEEK);
    switch (dayOfWeek_t) {
        case Calendar.SUNDAY:
            dayOfWeek_t = 0;
            break;
        case Calendar.MONDAY:
            dayOfWeek_t = 1;
            break;
        case Calendar.TUESDAY:
            dayOfWeek_t = 2;
            break;
        case Calendar.WEDNESDAY:
            dayOfWeek_t = 3;
            break;
        case Calendar.THURSDAY:
            dayOfWeek_t = 4;
            break;
        case Calendar.FRIDAY:
            dayOfWeek_t = 5;
            break;
        case Calendar.SATURDAY:
            break;
    }
    final int dayOfWeek = dayOfWeek_t;
    robot.chipSetCurrentClock(year, (byte) (month + 1), (byte) day, (byte) hour, (byte) minute, (byte) seconds, (byte) dayOfWeek);
}
 
开发者ID:WowWeeLabs,项目名称:CHIP-Android-SDK,代码行数:36,代码来源:AlarmFragment.java

示例8: parseWeekday

public static int parseWeekday(String s) {
    if(s == null) return -1;
    switch(s.toLowerCase()) {
        case "monday": return Calendar.MONDAY;
        case "tuesday": return Calendar.TUESDAY;
        case "wednesday": return Calendar.WEDNESDAY;
        case "thursday": return Calendar.THURSDAY;
        case "friday": return Calendar.FRIDAY;
        case "saturday": return Calendar.SATURDAY;
        case "sunday": return Calendar.SUNDAY;
        default: return -1;
    }
}
 
开发者ID:ste-bo,项目名称:workdays,代码行数:13,代码来源:DateUtils.java

示例9: getWeek

private String getWeek(String pTime) {
    String Week = "";
    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
    Calendar c = Calendar.getInstance();
    try {
        c.setTime(format.parse(pTime));
    } catch (ParseException e) {
        return null;
    }
    switch (c.get(Calendar.DAY_OF_WEEK)){
        case Calendar.SUNDAY:
            Week = "周日";
            break;
        case Calendar.MONDAY:
            Week = "周一";
            break;
        case Calendar.TUESDAY:
            Week = "周二";
            break;
        case Calendar.WEDNESDAY:
            Week = "周三";
            break;
        case Calendar.THURSDAY:
            Week = "周四";
            break;
        case Calendar.FRIDAY:
            Week = "周五";
            break;
        case Calendar.SATURDAY:
            Week = "周六";
            break;
    }
    return Week;
}
 
开发者ID:xfangfang,项目名称:NeuTV,代码行数:34,代码来源:Video.java

示例10: getValueAt

public Object getValueAt(int row, int col) {
	Event ev = getEventAt(row,col);
	if(ev == null) return "";
	Calendar cal = (Calendar)days[col].get(row);
	String res = "";
	switch(cal.get(Calendar.DAY_OF_WEEK)){
		case Calendar.SUNDAY: res += "SU";
			break;
		case Calendar.MONDAY: res += "MO";
			break;
		case Calendar.TUESDAY: res += "TU";
			break;
		case Calendar.WEDNESDAY: res += "WE";
			break;
		case Calendar.THURSDAY: res += "TH";
			break;
		case Calendar.FRIDAY: res += "FR";
			break;
		case Calendar.SATURDAY: res += "SA";
			break;
		default: res += "??";
	}
	String dOM = cal.get(Calendar.DAY_OF_MONTH) + "";
	switch(cal.get(Calendar.DAY_OF_MONTH)%10){
		case 1: dOM += "st";
			break;
		case 2: dOM += "nd";
			break;
		case 3: dOM += "rd";
			break;
		default:dOM+="th";
	}
	res+= " / " + dOM  + ": ";
	if(ev.getText().equals("")) res+= "EVENT";
	else res += ev.getText();
	return res;       		
}
 
开发者ID:ser316asu,项目名称:SER316-Dresden,代码行数:37,代码来源:EventsTableMonthly.java

示例11: getShortDate

public String getShortDate(Date date) {
    Calendar c = Calendar.getInstance(Locale.US);
    c.setTime(date);
    String day = "";
    switch (c.get(Calendar.DAY_OF_WEEK)) {
        case Calendar.MONDAY : day = DAY_NAMES_SHORT[Constants.DAY_MON]; break;
        case Calendar.TUESDAY : day = DAY_NAMES_SHORT[Constants.DAY_TUE]; break;
        case Calendar.WEDNESDAY : day = DAY_NAMES_SHORT[Constants.DAY_WED]; break;
        case Calendar.THURSDAY : day = DAY_NAMES_SHORT[Constants.DAY_THU]; break;
        case Calendar.FRIDAY : day = DAY_NAMES_SHORT[Constants.DAY_FRI]; break;
        case Calendar.SATURDAY : day = DAY_NAMES_SHORT[Constants.DAY_SAT]; break;
        case Calendar.SUNDAY : day = DAY_NAMES_SHORT[Constants.DAY_SUN]; break;
    }
    return day+" "+new SimpleDateFormat("MM/dd").format(date);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:15,代码来源:PdfLegacyExamReport.java

示例12: getIntDayOfWeek

protected int getIntDayOfWeek(String dayOfWeek) throws UDFArgumentException {
  if (dayOfWeek == null) {
    return -1;
  }
  if (MON.matches(dayOfWeek)) {
    return Calendar.MONDAY;
  }
  if (TUE.matches(dayOfWeek)) {
    return Calendar.TUESDAY;
  }
  if (WED.matches(dayOfWeek)) {
    return Calendar.WEDNESDAY;
  }
  if (THU.matches(dayOfWeek)) {
    return Calendar.THURSDAY;
  }
  if (FRI.matches(dayOfWeek)) {
    return Calendar.FRIDAY;
  }
  if (SAT.matches(dayOfWeek)) {
    return Calendar.SATURDAY;
  }
  if (SUN.matches(dayOfWeek)) {
    return Calendar.SUNDAY;
  }
  return -1;
}
 
开发者ID:myui,项目名称:hive-udf-backports,代码行数:27,代码来源:GenericUDFNextDay.java

示例13: setTimings

private void setTimings(List<RestaurantTiming> timings) {

        for (int i = 0; i < timings.size(); i++) {
            switch (AppUtils.getDay(timings.get(i).getDay())) {

                case Calendar.MONDAY:
                    timingMonday.setText(timings.get(i).getTiming());
                    break;
                case Calendar.TUESDAY:
                    timingTuesday.setText(timings.get(i).getTiming());
                    break;
                case Calendar.WEDNESDAY:
                    timingWednesday.setText(timings.get(i).getTiming());
                    break;
                case Calendar.THURSDAY:
                    timingThursday.setText(timings.get(i).getTiming());
                    break;
                case Calendar.FRIDAY:
                    timingFriday.setText(timings.get(i).getTiming());
                    break;
                case Calendar.SATURDAY:
                    timingSaturday.setText(timings.get(i).getTiming());
                    break;
                case Calendar.SUNDAY:
                    timingSunday.setText(timings.get(i).getTiming());
                    break;
            }
        }
        setToday();
    }
 
开发者ID:PacktPublishing,项目名称:Expert-Android-Programming,代码行数:30,代码来源:PlaceDetailActivity.java

示例14: createCurrentTimeValue

private static byte[] createCurrentTimeValue() {
	byte[] arrayOfByte = new byte[10];
	Calendar localCalendar = Calendar.getInstance();
	int i = localCalendar.get(1);
	arrayOfByte[0] = (byte) (0xFF & i >>> 0);
	arrayOfByte[1] = (byte) (0xFF & i >>> 8);
	arrayOfByte[2] = (byte) (1 + localCalendar.get(2));
	arrayOfByte[3] = (byte) localCalendar.get(5);
	arrayOfByte[4] = (byte) localCalendar.get(11);
	arrayOfByte[5] = (byte) localCalendar.get(12);
	arrayOfByte[6] = (byte) (localCalendar.get(13) + 1);
	switch (localCalendar.get(7)) {
	case Calendar.MONDAY:
		arrayOfByte[7] = 0x01;
		break;
	case Calendar.TUESDAY:
		arrayOfByte[7] = 0x02;
		break;
	case Calendar.WEDNESDAY:
		arrayOfByte[7] = 0x03;
		break;
	case Calendar.THURSDAY:
		arrayOfByte[7] = 0x04;
		break;
	case Calendar.FRIDAY:
		arrayOfByte[7] = 0x05;
		break;
	case Calendar.SATURDAY:
		arrayOfByte[7] = 0x06;
		break;
	case Calendar.SUNDAY:
		arrayOfByte[7] = 0x07;
		break;
	}
	arrayOfByte[8] = (byte) (int) TimeUnit.MILLISECONDS.toSeconds(256 * localCalendar.get(14));
	arrayOfByte[9] = 0;
	return arrayOfByte;
}
 
开发者ID:masterjc,项目名称:bluewatcher,代码行数:38,代码来源:TimeService.java

示例15: getDates

/**
 * Return all dates marked yellow in the given date pattern that are matching the selected day code (days of week)
 */
@Override
public List<Date> getDates(int minsPerWeek, DatePattern datePattern, int dayCode, int minutesPerMeeting) {
	List<Date> ret = new ArrayList<Date>();
	if (datePattern == null) return ret;
	Calendar cal = Calendar.getInstance(Locale.US);
	cal.setTime(datePattern.getStartDate()); cal.setLenient(true);
       EventDateMapping.Class2EventDateMap class2eventDates = EventDateMapping.getMapping(datePattern.getSession().getUniqueId());
       String pattern = datePattern.getPattern();
       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.add(class2eventDates.getEventDate(cal.getTime()));
       	}
       	cal.add(Calendar.DAY_OF_YEAR, 1);
       }
	return ret;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:29,代码来源:MinutesPerWeek.java


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