• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java DayOfWeek类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.threeten.bp.DayOfWeek的典型用法代码示例。如果您正苦于以下问题:Java DayOfWeek类的具体用法?Java DayOfWeek怎么用?Java DayOfWeek使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: getNextTuesdayMorningTimestamp

import org.threeten.bp.DayOfWeek; //导入依赖的package包/类
public static long getNextTuesdayMorningTimestamp(boolean allowSameDay) {
    ZonedDateTime nextTuesday;

    if (allowSameDay) {
        // If today is Tuesday (before 08:10), we'll get a timestamp in the future. Great !
        // If today is Tuesday (after 08:10), we'll get a timestamp in the past, AlarmManager is garanteed to trigger immediatly. Neat.
        // If today is not Tuesday, everything is fine, we get next tuesday epoch
        nextTuesday = getNowTime().with(TemporalAdjusters.nextOrSame(DayOfWeek.TUESDAY));
    } else {
        // We are tuesday, get next week timestamp with TemporalAdjusters.next instead of TemporalAdjusters.nextOrSame
        // If we are not tuesday, it doesn't "loop over" and give a timestamp in > 7 days
        nextTuesday = getNowTime().with(TemporalAdjusters.next(DayOfWeek.TUESDAY));
    }

    nextTuesday = nextTuesday.with(LocalTime.of(8, 10)); // TODO VOLKO USER CAN SET THIS IN OPTION

    return nextTuesday.toInstant().toEpochMilli();
}
 
开发者ID:NinoDLC,项目名称:CineReminDay,代码行数:19,代码来源:CRDTimeManager.java


示例2: nextWeekDay

import org.threeten.bp.DayOfWeek; //导入依赖的package包/类
/**
 * Gets the next Monday to Friday week-day after now.
 * 
 * @param startDate the date to start from
 * @return the date, not null
 */
public static LocalDate nextWeekDay(LocalDate startDate) {
  if (startDate == null) {
    throw new IllegalArgumentException("date was null");
  }
  LocalDate next = null;
  DayOfWeek dayOfWeek = startDate.getDayOfWeek();
  switch (dayOfWeek) {
    case FRIDAY:
      next = startDate.plusDays(3);
      break;
    case SATURDAY:
      next = startDate.plusDays(2);
      break;
    case MONDAY:
    case TUESDAY:
    case WEDNESDAY:
    case THURSDAY:
    case SUNDAY:
      next = startDate.plusDays(1);
      break;
    default:
      throw new OpenGammaRuntimeException("Unrecognised day of the week");
  }
  return next;
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:32,代码来源:DateUtils.java


示例3: previousWeekDay

import org.threeten.bp.DayOfWeek; //导入依赖的package包/类
/**
 * Gets the previous Monday to Friday week-day before now.
 * 
 * @param startDate the date to start from
 * @return the date, not null
 */
public static LocalDate previousWeekDay(LocalDate startDate) {
  if (startDate == null) {
    throw new IllegalArgumentException("date was null");
  }
  LocalDate previous = null;
  DayOfWeek dayOfWeek = startDate.getDayOfWeek();
  switch (dayOfWeek) {
    case MONDAY:
      previous = startDate.minusDays(3);
      break;
    case TUESDAY:
    case WEDNESDAY:
    case THURSDAY:
    case FRIDAY:
    case SATURDAY:
      previous = startDate.minusDays(1);
      break;
    case SUNDAY:
      previous = startDate.minusDays(2);
      break;
    default:
      throw new OpenGammaRuntimeException("Unrecognised day of the week");
  }
  return previous;
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:32,代码来源:DateUtils.java


示例4: test

import org.threeten.bp.DayOfWeek; //导入依赖的package包/类
@Test
public void test() {
  assertEquals(ScheduleCalculatorFactory.getScheduleCalculator(ScheduleCalculatorFactory.DAILY), ScheduleCalculatorFactory.DAILY_CALCULATOR);
  assertEquals(ScheduleCalculatorFactory.getScheduleCalculator(ScheduleCalculatorFactory.WEEKLY), ScheduleCalculatorFactory.WEEKLY_CALCULATOR);
  assertEquals(ScheduleCalculatorFactory.getScheduleCalculator(ScheduleCalculatorFactory.MONTHLY), ScheduleCalculatorFactory.MONTHLY_CALCULATOR);
  assertEquals(ScheduleCalculatorFactory.getScheduleCalculator(ScheduleCalculatorFactory.FIRST_OF_MONTH), ScheduleCalculatorFactory.FIRST_OF_MONTH_CALCULATOR);
  assertEquals(ScheduleCalculatorFactory.getScheduleCalculator(ScheduleCalculatorFactory.END_OF_MONTH), ScheduleCalculatorFactory.END_OF_MONTH_CALCULATOR);
  assertEquals(ScheduleCalculatorFactory.getScheduleCalculator(ScheduleCalculatorFactory.QUARTERLY), ScheduleCalculatorFactory.QUARTERLY_CALCULATOR);
  assertEquals(ScheduleCalculatorFactory.getScheduleCalculator(ScheduleCalculatorFactory.QUARTERLY_EOM), ScheduleCalculatorFactory.QUARTERLY_EOM_CALCULATOR);
  assertEquals(ScheduleCalculatorFactory.getScheduleCalculator(ScheduleCalculatorFactory.SEMI_ANNUAL), ScheduleCalculatorFactory.SEMI_ANNUAL_CALCULATOR);
  assertEquals(ScheduleCalculatorFactory.getScheduleCalculator(ScheduleCalculatorFactory.SEMI_ANNUAL_EOM), ScheduleCalculatorFactory.SEMI_ANNUAL_EOM_CALCULATOR);
  assertEquals(ScheduleCalculatorFactory.getScheduleCalculator(ScheduleCalculatorFactory.ANNUAL), ScheduleCalculatorFactory.ANNUAL_CALCULATOR);
  assertEquals(ScheduleCalculatorFactory.getScheduleCalculator(ScheduleCalculatorFactory.FIRST_OF_YEAR), ScheduleCalculatorFactory.FIRST_OF_YEAR_CALCULATOR);
  assertEquals(ScheduleCalculatorFactory.getScheduleCalculator(ScheduleCalculatorFactory.END_OF_YEAR), ScheduleCalculatorFactory.END_OF_YEAR_CALCULATOR);
  assertEquals(ScheduleCalculatorFactory.getScheduleCalculator(ScheduleCalculatorFactory.ANNUAL_EOM), ScheduleCalculatorFactory.ANNUAL_EOM_CALCULATOR);
  assertEquals(ScheduleCalculatorFactory.getScheduleCalculator(ScheduleCalculatorFactory.WEEKLY_ON_DAY, DayOfWeek.MONDAY), new WeeklyScheduleOnDayCalculator(DayOfWeek.MONDAY));
  assertEquals(ScheduleCalculatorFactory.getScheduleCalculator(ScheduleCalculatorFactory.ANNUAL_ON_DAY_AND_MONTH, 11, Month.APRIL), new AnnualScheduleOnDayAndMonthCalculator(11,
      Month.APRIL));
}
 
开发者ID:DevStreet,项目名称:FinanceAnalytics,代码行数:20,代码来源:ScheduleCalculatorFactoryTest.java


示例5: onHandleWork

import org.threeten.bp.DayOfWeek; //导入依赖的package包/类
@Override protected void onHandleWork(@NonNull Intent intent) {
  // Get lesson list for current day
  if (mFavoriteSyncIdPreference.get() != null) {
    DayOfWeek dayOfWeek = LocalDate.now().getDayOfWeek();
    Query query = Query.builder()
        .table(LessonEntry.TABLE_NAME)
        .where(LessonEntry.Query.builder(mFavoriteSyncIdPreference.get(),
            mFavoriteIsGroupSchedule.get())
            .weekDay(dayOfWeek)
            .subgroupFilter(mSubgroupFilterPreference.get())
            .weekNumber(Utils.getCurrentWeekNumber())
            .build()
            .toString())
        .build();
    List<Lesson> lessonList = mStorIOSQLite.get()
        .listOfObjects(Lesson.class)
        .withQuery(query)
        .prepare()
        .executeAsBlocking();
    if (!lessonList.isEmpty()) {
      showNotification(lessonList);
    }
  }
}
 
开发者ID:drymarev,项目名称:rxbsuir,代码行数:25,代码来源:LessonReminderService.java


示例6: Lesson

import org.threeten.bp.DayOfWeek; //导入依赖的package包/类
public Lesson(@Nullable Long _id, @NonNull String syncId, List<String> auditoryList, List<Employee> employeeList, LocalTime lessonTimeStart, LocalTime lessonTimeEnd, String lessonType, String note, int numSubgroup, List<String> studentGroupList, String subject, List<Integer> weekNumberList, DayOfWeek weekday, boolean isGroupSchedule) {
    this._id = _id;
    this.syncId = syncId;
    this.auditoryList = auditoryList;
    this.employeeList = employeeList;
    this.lessonTimeStart = lessonTimeStart;
    this.lessonTimeEnd = lessonTimeEnd;
    this.lessonType = lessonType;
    this.note = note;
    this.numSubgroup = numSubgroup;
    this.studentGroupList = studentGroupList;
    this.subject = subject;
    this.weekNumberList = weekNumberList;
    this.weekday = weekday;
    this.isGroupSchedule = isGroupSchedule;
}
 
开发者ID:drymarev,项目名称:rxbsuir,代码行数:17,代码来源:Lesson.java


示例7: convertWeekdayToDayOfWeek

import org.threeten.bp.DayOfWeek; //导入依赖的package包/类
/**
 * Convert weekday to {@link DayOfWeek}.
 *
 * @param weekday the weekday
 * @return the day of week
 */
public static DayOfWeek convertWeekdayToDayOfWeek(@NonNull String weekday) {
    switch (weekday.toLowerCase()) {
        case "понедельник":
            return DayOfWeek.MONDAY;
        case "вторник":
            return DayOfWeek.TUESDAY;
        case "среда":
            return DayOfWeek.WEDNESDAY;
        case "четверг":
            return DayOfWeek.THURSDAY;
        case "пятница":
            return DayOfWeek.FRIDAY;
        case "суббота":
            return DayOfWeek.SATURDAY;
        case "воскресенье":
            return DayOfWeek.SUNDAY;
        default:
            throw new IllegalArgumentException("Unknown weekday: " + weekday);
    }
}
 
开发者ID:drymarev,项目名称:rxbsuir,代码行数:27,代码来源:Utils.java


示例8: Course

import org.threeten.bp.DayOfWeek; //导入依赖的package包/类
/**
 * Constructor used for the user's already registered classes
 *
 * @param subject    The course subject
 * @param number     The course number
 * @param title      The course title
 * @param crn        The course CRN
 * @param section    The course section
 * @param startTime  The course's ending time
 * @param endTime    The course's starting time
 * @param days       The days this course is on
 * @param type       The course type
 * @param location   The course location
 * @param instructor The course instructor
 * @param credits    The number of credits
 * @param startDate  The starting date for this course
 * @param endDate    The ending date for this course
 */
public Course(String subject, String number, String title, int crn, String section,
        LocalTime startTime, LocalTime endTime, List<DayOfWeek> days, String type,
        String location, String instructor, double credits, LocalDate startDate,
        LocalDate endDate) {
    id = UUID.randomUUID().toString();
    this.subject = subject;
    this.number = number;
    this.title = title;
    this.crn = crn;
    this.section = section;
    this.startTime = startTime;
    this.endTime = endTime;
    this.days = days;
    this.type = type;
    this.location = location;
    this.instructor = instructor;
    this.credits = credits;
    this.startDate = startDate;
    this.endDate = endDate;
}
 
开发者ID:jguerinet,项目名称:MyMartlet,代码行数:39,代码来源:Course.java


示例9: getDay

import org.threeten.bp.DayOfWeek; //导入依赖的package包/类
/**
 * Gets the day based on a character (M, T, W, R, F, S, N). Characters taken from Minerva
 *
 * @param dayChar The day character
 * @return The corresponding day
 */
public static DayOfWeek getDay(char dayChar) {
    switch (dayChar) {
        case 'M':
            return DayOfWeek.MONDAY;
        case 'T':
            return DayOfWeek.TUESDAY;
        case 'W':
            return DayOfWeek.WEDNESDAY;
        case 'R':
            return DayOfWeek.THURSDAY;
        case 'F':
            return DayOfWeek.FRIDAY;
        case 'S':
            return DayOfWeek.SATURDAY;
        case 'U':
            return DayOfWeek.SUNDAY;
        default:
            throw new IllegalStateException("Unknown day character: " + dayChar);
    }
}
 
开发者ID:jguerinet,项目名称:MyMartlet,代码行数:27,代码来源:DayUtils.java


示例10: getDayChar

import org.threeten.bp.DayOfWeek; //导入依赖的package包/类
/**
 * Gets the character for a given day
 *
 * @return The day character
 */
public static char getDayChar(DayOfWeek day) {
    switch (day) {
        case MONDAY:
            return 'M';
        case TUESDAY:
            return 'T';
        case WEDNESDAY:
            return 'W';
        case THURSDAY:
            return 'R';
        case FRIDAY:
            return 'F';
        case SATURDAY:
            return 'S';
        case SUNDAY:
            return 'N';
        default:
            throw new IllegalStateException("Unknown day: " + day);
    }
}
 
开发者ID:jguerinet,项目名称:MyMartlet,代码行数:26,代码来源:DayUtils.java


示例11: getStringId

import org.threeten.bp.DayOfWeek; //导入依赖的package包/类
/**
 * Returns the String Id for this given day
 *
 * @param day Day
 * @return Corresponding String Id
 */
public static @StringRes int getStringId(DayOfWeek day) {
    switch (day) {
        case MONDAY:
            return R.string.monday;
        case TUESDAY:
            return R.string.tuesday;
        case WEDNESDAY:
            return R.string.wednesday;
        case THURSDAY:
            return R.string.thursday;
        case FRIDAY:
            return R.string.friday;
        case SATURDAY:
            return R.string.saturday;
        case SUNDAY:
            return R.string.sunday;
        default:
            throw new IllegalStateException("Unknown day " + day);
    }
}
 
开发者ID:jguerinet,项目名称:MyMartlet,代码行数:27,代码来源:DayUtils.java


示例12: HijrahDate

import org.threeten.bp.DayOfWeek; //导入依赖的package包/类
/**
 * Constructs an instance with the specified date.
 *
 * @param gregorianDay  the number of days from 0001/01/01 (Gregorian), caller calculated
 */
private HijrahDate(long gregorianDay) {
    int[] dateInfo = getHijrahDateInfo(gregorianDay);

    checkValidYearOfEra(dateInfo[1]);
    checkValidMonth(dateInfo[2]);
    checkValidDayOfMonth(dateInfo[3]);
    checkValidDayOfYear(dateInfo[4]);

    this.era = HijrahEra.of(dateInfo[0]);
    this.yearOfEra = dateInfo[1];
    this.monthOfYear = dateInfo[2];
    this.dayOfMonth = dateInfo[3];
    this.dayOfYear = dateInfo[4];
    this.dayOfWeek = DayOfWeek.of(dateInfo[5]);
    this.gregorianEpochDay = gregorianDay;
    this.isLeapYear = isLeapYear(this.yearOfEra);
}
 
开发者ID:ThreeTen,项目名称:threetenbp,代码行数:23,代码来源:HijrahDate.java


示例13: of

import org.threeten.bp.DayOfWeek; //导入依赖的package包/类
/**
 * Obtains an instance defining the yearly rule to create transitions between two offsets.
 * <p>
 * Applications should normally obtain an instance from {@link ZoneRules}.
 * This factory is only intended for use when creating {@link ZoneRules}.
 *
 * @param month  the month of the month-day of the first day of the cutover week, not null
 * @param dayOfMonthIndicator  the day of the month-day of the cutover week, positive if the week is that
 *  day or later, negative if the week is that day or earlier, counting from the last day of the month,
 *  from -28 to 31 excluding 0
 * @param dayOfWeek  the required day-of-week, null if the month-day should not be changed
 * @param time  the cutover time in the 'before' offset, not null
 * @param timeEndOfDay  whether the time is midnight at the end of day
 * @param timeDefnition  how to interpret the cutover
 * @param standardOffset  the standard offset in force at the cutover, not null
 * @param offsetBefore  the offset before the cutover, not null
 * @param offsetAfter  the offset after the cutover, not null
 * @return the rule, not null
 * @throws IllegalArgumentException if the day of month indicator is invalid
 * @throws IllegalArgumentException if the end of day flag is true when the time is not midnight
 */
public static ZoneOffsetTransitionRule of(
        Month month,
        int dayOfMonthIndicator,
        DayOfWeek dayOfWeek,
        LocalTime time,
        boolean timeEndOfDay,
        TimeDefinition timeDefnition,
        ZoneOffset standardOffset,
        ZoneOffset offsetBefore,
        ZoneOffset offsetAfter) {
    Jdk8Methods.requireNonNull(month, "month");
    Jdk8Methods.requireNonNull(time, "time");
    Jdk8Methods.requireNonNull(timeDefnition, "timeDefnition");
    Jdk8Methods.requireNonNull(standardOffset, "standardOffset");
    Jdk8Methods.requireNonNull(offsetBefore, "offsetBefore");
    Jdk8Methods.requireNonNull(offsetAfter, "offsetAfter");
    if (dayOfMonthIndicator < -28 || dayOfMonthIndicator > 31 || dayOfMonthIndicator == 0) {
        throw new IllegalArgumentException("Day of month indicator must be between -28 and 31 inclusive excluding zero");
    }
    if (timeEndOfDay && time.equals(LocalTime.MIDNIGHT) == false) {
        throw new IllegalArgumentException("Time must be midnight when end of day flag is true");
    }
    return new ZoneOffsetTransitionRule(month, dayOfMonthIndicator, dayOfWeek, time, timeEndOfDay, timeDefnition, standardOffset, offsetBefore, offsetAfter);
}
 
开发者ID:ThreeTen,项目名称:threetenbp,代码行数:46,代码来源:ZoneOffsetTransitionRule.java


示例14: ZoneOffsetTransitionRule

import org.threeten.bp.DayOfWeek; //导入依赖的package包/类
/**
 * Creates an instance defining the yearly rule to create transitions between two offsets.
 *
 * @param month  the month of the month-day of the first day of the cutover week, not null
 * @param dayOfMonthIndicator  the day of the month-day of the cutover week, positive if the week is that
 *  day or later, negative if the week is that day or earlier, counting from the last day of the month,
 *  from -28 to 31 excluding 0
 * @param dayOfWeek  the required day-of-week, null if the month-day should not be changed
 * @param time  the cutover time in the 'before' offset, not null
 * @param timeEndOfDay  whether the time is midnight at the end of day
 * @param timeDefnition  how to interpret the cutover
 * @param standardOffset  the standard offset in force at the cutover, not null
 * @param offsetBefore  the offset before the cutover, not null
 * @param offsetAfter  the offset after the cutover, not null
 * @throws IllegalArgumentException if the day of month indicator is invalid
 * @throws IllegalArgumentException if the end of day flag is true when the time is not midnight
 */
ZoneOffsetTransitionRule(
        Month month,
        int dayOfMonthIndicator,
        DayOfWeek dayOfWeek,
        LocalTime time,
        boolean timeEndOfDay,
        TimeDefinition timeDefnition,
        ZoneOffset standardOffset,
        ZoneOffset offsetBefore,
        ZoneOffset offsetAfter) {
    this.month = month;
    this.dom = (byte) dayOfMonthIndicator;
    this.dow = dayOfWeek;
    this.time = time;
    this.timeEndOfDay = timeEndOfDay;
    this.timeDefinition = timeDefnition;
    this.standardOffset = standardOffset;
    this.offsetBefore = offsetBefore;
    this.offsetAfter = offsetAfter;
}
 
开发者ID:ThreeTen,项目名称:threetenbp,代码行数:38,代码来源:ZoneOffsetTransitionRule.java


示例15: readExternal

import org.threeten.bp.DayOfWeek; //导入依赖的package包/类
/**
 * Reads the state from the stream.
 *
 * @param in  the input stream, not null
 * @return the created object, not null
 * @throws IOException if an error occurs
 */
static ZoneOffsetTransitionRule readExternal(DataInput in) throws IOException {
    int data = in.readInt();
    Month month = Month.of(data >>> 28);
    int dom = ((data & (63 << 22)) >>> 22) - 32;
    int dowByte = (data & (7 << 19)) >>> 19;
    DayOfWeek dow = dowByte == 0 ? null : DayOfWeek.of(dowByte);
    int timeByte = (data & (31 << 14)) >>> 14;
    TimeDefinition defn = TimeDefinition.values()[(data & (3 << 12)) >>> 12];
    int stdByte = (data & (255 << 4)) >>> 4;
    int beforeByte = (data & (3 << 2)) >>> 2;
    int afterByte = (data & 3);
    LocalTime time = (timeByte == 31 ? LocalTime.ofSecondOfDay(in.readInt()) : LocalTime.of(timeByte % 24, 0));
    ZoneOffset std = (stdByte == 255 ? ZoneOffset.ofTotalSeconds(in.readInt()) : ZoneOffset.ofTotalSeconds((stdByte - 128) * 900));
    ZoneOffset before = (beforeByte == 3 ? ZoneOffset.ofTotalSeconds(in.readInt()) : ZoneOffset.ofTotalSeconds(std.getTotalSeconds() + beforeByte * 1800));
    ZoneOffset after = (afterByte == 3 ? ZoneOffset.ofTotalSeconds(in.readInt()) : ZoneOffset.ofTotalSeconds(std.getTotalSeconds() + afterByte * 1800));
    return ZoneOffsetTransitionRule.of(month, dom, dow, time, timeByte == 24, defn, std, before, after);
}
 
开发者ID:ThreeTen,项目名称:threetenbp,代码行数:25,代码来源:ZoneOffsetTransitionRule.java


示例16: test_next

import org.threeten.bp.DayOfWeek; //导入依赖的package包/类
@Test
public void test_next() {
    for (Month month : Month.values()) {
        for (int i = 1; i <= month.length(false); i++) {
            LocalDate date = date(2007, month, i);

            for (DayOfWeek dow : DayOfWeek.values()) {
                LocalDate test = (LocalDate) TemporalAdjusters.next(dow).adjustInto(date);

                assertSame(test.getDayOfWeek(), dow, date + " " + test);

                if (test.getYear() == 2007) {
                    int dayDiff = test.getDayOfYear() - date.getDayOfYear();
                    assertTrue(dayDiff > 0 && dayDiff < 8);
                } else {
                    assertSame(month, Month.DECEMBER);
                    assertTrue(date.getDayOfMonth() > 24);
                    assertEquals(test.getYear(), 2008);
                    assertSame(test.getMonth(), Month.JANUARY);
                    assertTrue(test.getDayOfMonth() < 8);
                }
            }
        }
    }
}
 
开发者ID:ThreeTen,项目名称:threetenbp,代码行数:26,代码来源:TestTemporalAdjusters.java


示例17: test_previous

import org.threeten.bp.DayOfWeek; //导入依赖的package包/类
@Test
public void test_previous() {
    for (Month month : Month.values()) {
        for (int i = 1; i <= month.length(false); i++) {
            LocalDate date = date(2007, month, i);

            for (DayOfWeek dow : DayOfWeek.values()) {
                LocalDate test = (LocalDate) TemporalAdjusters.previous(dow).adjustInto(date);

                assertSame(test.getDayOfWeek(), dow, date + " " + test);

                if (test.getYear() == 2007) {
                    int dayDiff = test.getDayOfYear() - date.getDayOfYear();
                    assertTrue(dayDiff < 0 && dayDiff > -8, dayDiff + " " + test);
                } else {
                    assertSame(month, Month.JANUARY);
                    assertTrue(date.getDayOfMonth() < 8);
                    assertEquals(test.getYear(), 2006);
                    assertSame(test.getMonth(), Month.DECEMBER);
                    assertTrue(test.getDayOfMonth() > 24);
                }
            }
        }
    }
}
 
开发者ID:ThreeTen,项目名称:threetenbp,代码行数:26,代码来源:TestTemporalAdjusters.java


示例18: test_getters_floatingWeek

import org.threeten.bp.DayOfWeek; //导入依赖的package包/类
@Test
public void test_getters_floatingWeek() throws Exception {
    ZoneOffsetTransitionRule test = ZoneOffsetTransitionRule.of(
            Month.MARCH, 20, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL,
            OFFSET_0200, OFFSET_0200, OFFSET_0300);
    assertEquals(test.getMonth(), Month.MARCH);
    assertEquals(test.getDayOfMonthIndicator(), 20);
    assertEquals(test.getDayOfWeek(), DayOfWeek.SUNDAY);
    assertEquals(test.getLocalTime(), TIME_0100);
    assertEquals(test.isMidnightEndOfDay(), false);
    assertEquals(test.getTimeDefinition(), TimeDefinition.WALL);
    assertEquals(test.getStandardOffset(), OFFSET_0200);
    assertEquals(test.getOffsetBefore(), OFFSET_0200);
    assertEquals(test.getOffsetAfter(), OFFSET_0300);
    assertSerializable(test);
}
 
开发者ID:ThreeTen,项目名称:threetenbp,代码行数:17,代码来源:TestZoneOffsetTransitionRule.java


示例19: test_getters_floatingWeekBackwards

import org.threeten.bp.DayOfWeek; //导入依赖的package包/类
@Test
public void test_getters_floatingWeekBackwards() throws Exception {
    ZoneOffsetTransitionRule test = ZoneOffsetTransitionRule.of(
            Month.MARCH, -1, DayOfWeek.SUNDAY, TIME_0100, false, TimeDefinition.WALL,
            OFFSET_0200, OFFSET_0200, OFFSET_0300);
    assertEquals(test.getMonth(), Month.MARCH);
    assertEquals(test.getDayOfMonthIndicator(), -1);
    assertEquals(test.getDayOfWeek(), DayOfWeek.SUNDAY);
    assertEquals(test.getLocalTime(), TIME_0100);
    assertEquals(test.isMidnightEndOfDay(), false);
    assertEquals(test.getTimeDefinition(), TimeDefinition.WALL);
    assertEquals(test.getStandardOffset(), OFFSET_0200);
    assertEquals(test.getOffsetBefore(), OFFSET_0200);
    assertEquals(test.getOffsetAfter(), OFFSET_0300);
    assertSerializable(test);
}
 
开发者ID:ThreeTen,项目名称:threetenbp,代码行数:17,代码来源:TestZoneOffsetTransitionRule.java


示例20: test_parseDayOfWeek

import org.threeten.bp.DayOfWeek; //导入依赖的package包/类
@Test
public void test_parseDayOfWeek() throws Exception {
    TzdbZoneRulesCompiler test = new TzdbZoneRulesCompiler("2010c", new ArrayList<File>(), null, false);
    assertEquals(parseDayOfWeek(test, "Mon"), DayOfWeek.MONDAY);
    assertEquals(parseDayOfWeek(test, "Tue"), DayOfWeek.TUESDAY);
    assertEquals(parseDayOfWeek(test, "Wed"), DayOfWeek.WEDNESDAY);
    assertEquals(parseDayOfWeek(test, "Thu"), DayOfWeek.THURSDAY);
    assertEquals(parseDayOfWeek(test, "Fri"), DayOfWeek.FRIDAY);
    assertEquals(parseDayOfWeek(test, "Sat"), DayOfWeek.SATURDAY);
    assertEquals(parseDayOfWeek(test, "Sun"), DayOfWeek.SUNDAY);
    assertEquals(parseDayOfWeek(test, "Monday"), DayOfWeek.MONDAY);
    assertEquals(parseDayOfWeek(test, "Tuesday"), DayOfWeek.TUESDAY);
    assertEquals(parseDayOfWeek(test, "Wednesday"), DayOfWeek.WEDNESDAY);
    assertEquals(parseDayOfWeek(test, "Thursday"), DayOfWeek.THURSDAY);
    assertEquals(parseDayOfWeek(test, "Friday"), DayOfWeek.FRIDAY);
    assertEquals(parseDayOfWeek(test, "Saturday"), DayOfWeek.SATURDAY);
    assertEquals(parseDayOfWeek(test, "Sunday"), DayOfWeek.SUNDAY);
    assertEquals(parseDayOfWeek(test, "Mond"), DayOfWeek.MONDAY);
    assertEquals(parseDayOfWeek(test, "Monda"), DayOfWeek.MONDAY);
}
 
开发者ID:ThreeTen,项目名称:threetenbp,代码行数:21,代码来源:TestTzdbZoneRulesCompiler.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java OWLDataOneOf类代码示例发布时间:2022-05-22
下一篇:
Java DeclarationVisitor类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap