本文整理汇总了Java中com.ibm.icu.util.Calendar.SATURDAY属性的典型用法代码示例。如果您正苦于以下问题:Java Calendar.SATURDAY属性的具体用法?Java Calendar.SATURDAY怎么用?Java Calendar.SATURDAY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.ibm.icu.util.Calendar
的用法示例。
在下文中一共展示了Calendar.SATURDAY属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
@SuppressWarnings("unchecked")
@Override
public void visit(TemporalExpressions.DayOfWeekRange expr) {
int startDay = expr.getStartDay();
int endDay = expr.getEndDay();
WeekDayList dayList = new WeekDayList();
dayList.add(dayOfWeekArray[startDay - 1]);
while (startDay != endDay) {
startDay++;
if (startDay > Calendar.SATURDAY) {
startDay = Calendar.SUNDAY;
}
dayList.add(dayOfWeekArray[startDay - 1]);
}
Recur recur = new Recur(Recur.DAILY, 0);
recur.getDayList().addAll(dayList);
this.state.addRecur(recur);
}
示例2: DayInMonth
/**
* @param dayOfWeek An integer in the range of <code>Calendar.SUNDAY</code>
* to <code>Calendar.SATURDAY</code>
* @param occurrence An integer in the range of -5 to 5, excluding zero
*/
public DayInMonth(int dayOfWeek, int occurrence) {
if (dayOfWeek < Calendar.SUNDAY || dayOfWeek > Calendar.SATURDAY) {
throw new IllegalArgumentException("Invalid day argument");
}
if (occurrence < -5 || occurrence == 0 || occurrence > 5) {
throw new IllegalArgumentException("Invalid occurrence argument");
}
this.dayOfWeek = dayOfWeek;
this.occurrence = occurrence;
int result = occurrence;
if (result < 0) {
// Make negative values a higher sequence
// Example: Last Monday should come after first Monday
result += 11;
}
this.sequence = SEQUENCE_DAY_IN_MONTH + (result * 10) + dayOfWeek;
if (Debug.verboseOn()) {
Debug.logVerbose("Created " + this, module);
}
}
示例3: getCalendarDay
private int getCalendarDay(String day) {
if (day != null) day = day.trim();
if (day.equalsIgnoreCase("MO"))
return Calendar.MONDAY;
if (day.equalsIgnoreCase("TU"))
return Calendar.TUESDAY;
if (day.equalsIgnoreCase("WE"))
return Calendar.WEDNESDAY;
if (day.equalsIgnoreCase("TH"))
return Calendar.THURSDAY;
if (day.equalsIgnoreCase("FR"))
return Calendar.FRIDAY;
if (day.equalsIgnoreCase("SA"))
return Calendar.SATURDAY;
if (day.equalsIgnoreCase("SU"))
return Calendar.SUNDAY;
return 0;
}
示例4: getDayPeriodSummaryString
public static String getDayPeriodSummaryString(Context context, int[] daysOfWeek) {
int[] weekdays = { Calendar.MONDAY, Calendar.TUESDAY, Calendar.WEDNESDAY, Calendar.THURSDAY,
Calendar.FRIDAY };
int[] weekend = { Calendar.SUNDAY, Calendar.SATURDAY };
int[] everyday = { Calendar.SUNDAY, Calendar.MONDAY, Calendar.TUESDAY, Calendar.WEDNESDAY,
Calendar.THURSDAY, Calendar.FRIDAY, Calendar.SATURDAY };
if (Arrays.equals(daysOfWeek, weekend)) {
return context.getString(R.string.alarm_list_weekend);
} else if (Arrays.equals(daysOfWeek, weekdays)) {
return context.getString(R.string.alarm_list_weekdays);
} else if (Arrays.equals(daysOfWeek, everyday)) {
return context.getString(R.string.alarm_list_every_day);
} else {
return getShortDayNamesString(daysOfWeek);
}
}
示例5: getOffset
/**
* TimeZone API.
*/
public int getOffset(int era, int year, int month,int dom, int dow, int millis, int monthLength){
if ((era != GregorianCalendar.AD && era != GregorianCalendar.BC)
|| month < Calendar.JANUARY
|| month > Calendar.DECEMBER
|| dom < 1
|| dom > monthLength
|| dow < Calendar.SUNDAY
|| dow > Calendar.SATURDAY
|| millis < 0
|| millis >= Grego.MILLIS_PER_DAY
|| monthLength < 28
|| monthLength > 31) {
throw new IllegalArgumentException();
}
if (era == GregorianCalendar.BC) {
year = -year;
}
if (finalZone != null && year >= finalStartYear) {
return finalZone.getOffset(era, year, month, dom, dow, millis);
}
// Compute local epoch millis from input fields
long time = Grego.fieldsToDay(year, month, dom) * Grego.MILLIS_PER_DAY + millis;
int[] offsets = new int[2];
getHistoricalOffset(time, true, LOCAL_DST, LOCAL_STD, offsets);
return offsets[0] + offsets[1];
}
示例6: setFirstDayOfWeek
@SuppressWarnings("unused")
public void setFirstDayOfWeek(int startOfWeek) {
if (startOfWeek < Calendar.SUNDAY || startOfWeek > Calendar.SATURDAY) {
throw new IllegalArgumentException("Value must be between Calendar.SUNDAY and " +
"Calendar.SATURDAY");
}
mWeekStart = startOfWeek;
if (mDayPickerView != null) {
mDayPickerView.onChange();
}
}
示例7: DayOfWeekRange
/**
* @param start An integer in the range of <code>Calendar.SUNDAY</code>
* to <code>Calendar.SATURDAY</code>
* @param end An integer in the range of <code>Calendar.SUNDAY</code>
* to <code>Calendar.SATURDAY</code>
*/
public DayOfWeekRange(int start, int end) {
if (start < Calendar.SUNDAY || start > Calendar.SATURDAY) {
throw new IllegalArgumentException("Invalid start argument");
}
if (end < Calendar.SUNDAY || end > Calendar.SATURDAY) {
throw new IllegalArgumentException("Invalid end argument");
}
this.sequence = SEQUENCE_DOW_RANGE + start;
this.start = start;
this.end = end;
if (Debug.verboseOn()) {
Debug.logVerbose("Created " + this, module);
}
}
示例8: getShortDayNames
public static String[] getShortDayNames() {
String[] dayNames = new String[7];
Format formatter = new SimpleDateFormat(TWO_CHARACTER_SHORT_DAY_PATTERN, Locale.getDefault());
Calendar calendar = Calendar.getInstance();
for(int d = Calendar.SUNDAY, i = 0; d <= Calendar.SATURDAY; d++, i++) {
calendar.set(Calendar.DAY_OF_WEEK, d);
dayNames[i] = formatter.format(calendar.getTime()).toUpperCase(Locale.getDefault());
}
return dayNames;
}
示例9: dayStartCapacityAvailable
/** Used to find the fisrt day in the TechDataCalendarWeek where capacity != 0, beginning at dayStart, dayStart included.
*
* @param techDataCalendarWeek The TechDataCalendarWeek cover
* @param dayStart
* @return a map with the capacity (Double) available and moveDay (int): the number of day it's necessary to move to have capacity available
*/
public static Map<String, Object> dayStartCapacityAvailable(GenericValue techDataCalendarWeek, int dayStart) {
Map<String, Object> result = FastMap.newInstance();
int moveDay = 0;
Double capacity = null;
Time startTime = null;
while (capacity == null || capacity.doubleValue()==0) {
switch (dayStart) {
case Calendar.MONDAY:
capacity = techDataCalendarWeek.getDouble("mondayCapacity");
startTime = techDataCalendarWeek.getTime("mondayStartTime");
break;
case Calendar.TUESDAY:
capacity = techDataCalendarWeek.getDouble("tuesdayCapacity");
startTime = techDataCalendarWeek.getTime("tuesdayStartTime");
break;
case Calendar.WEDNESDAY:
capacity = techDataCalendarWeek.getDouble("wednesdayCapacity");
startTime = techDataCalendarWeek.getTime("wednesdayStartTime");
break;
case Calendar.THURSDAY:
capacity = techDataCalendarWeek.getDouble("thursdayCapacity");
startTime = techDataCalendarWeek.getTime("thursdayStartTime");
break;
case Calendar.FRIDAY:
capacity = techDataCalendarWeek.getDouble("fridayCapacity");
startTime = techDataCalendarWeek.getTime("fridayStartTime");
break;
case Calendar.SATURDAY:
capacity = techDataCalendarWeek.getDouble("saturdayCapacity");
startTime = techDataCalendarWeek.getTime("saturdayStartTime");
break;
case Calendar.SUNDAY:
capacity = techDataCalendarWeek.getDouble("sundayCapacity");
startTime = techDataCalendarWeek.getTime("sundayStartTime");
break;
}
if (capacity == null || capacity.doubleValue() == 0) {
moveDay +=1;
dayStart = (dayStart==7) ? 1 : dayStart +1;
}
// Debug.logInfo("capacity loop: " + capacity+ " moveDay=" +moveDay, module);
}
result.put("capacity",capacity);
result.put("startTime",startTime);
result.put("moveDay",Integer.valueOf(moveDay));
return result;
}
示例10: dayEndCapacityAvailable
/** Used to find the last day in the TechDataCalendarWeek where capacity != 0, ending at dayEnd, dayEnd included.
*
* @param techDataCalendarWeek The TechDataCalendarWeek cover
* @param dayEnd
* @return a map with the capacity (Double) available, the startTime and moveDay (int): the number of day it's necessary to move to have capacity available
*/
public static Map<String, Object> dayEndCapacityAvailable(GenericValue techDataCalendarWeek, int dayEnd) {
Map<String, Object> result = FastMap.newInstance();
int moveDay = 0;
Double capacity = null;
Time startTime = null;
while (capacity == null || capacity.doubleValue() == 0) {
switch (dayEnd) {
case Calendar.MONDAY:
capacity = techDataCalendarWeek.getDouble("mondayCapacity");
startTime = techDataCalendarWeek.getTime("mondayStartTime");
break;
case Calendar.TUESDAY:
capacity = techDataCalendarWeek.getDouble("tuesdayCapacity");
startTime = techDataCalendarWeek.getTime("tuesdayStartTime");
break;
case Calendar.WEDNESDAY:
capacity = techDataCalendarWeek.getDouble("wednesdayCapacity");
startTime = techDataCalendarWeek.getTime("wednesdayStartTime");
break;
case Calendar.THURSDAY:
capacity = techDataCalendarWeek.getDouble("thursdayCapacity");
startTime = techDataCalendarWeek.getTime("thursdayStartTime");
break;
case Calendar.FRIDAY:
capacity = techDataCalendarWeek.getDouble("fridayCapacity");
startTime = techDataCalendarWeek.getTime("fridayStartTime");
break;
case Calendar.SATURDAY:
capacity = techDataCalendarWeek.getDouble("saturdayCapacity");
startTime = techDataCalendarWeek.getTime("saturdayStartTime");
break;
case Calendar.SUNDAY:
capacity = techDataCalendarWeek.getDouble("sundayCapacity");
startTime = techDataCalendarWeek.getTime("sundayStartTime");
break;
}
if (capacity == null || capacity.doubleValue() == 0) {
moveDay -=1;
dayEnd = (dayEnd==1) ? 7 : dayEnd - 1;
}
}
result.put("capacity",capacity);
result.put("startTime",startTime);
result.put("moveDay",Integer.valueOf(moveDay));
return result;
}