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


Java DayOfWeek.FRIDAY属性代码示例

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


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

示例1: data_week

@DataProvider(name="IsoWeekData")
Object[][] data_week() {
    return new Object[][] {
            {LocalDate.of(1969, 12, 29), DayOfWeek.MONDAY, 1, 1970},
            {LocalDate.of(2012, 12, 23), DayOfWeek.SUNDAY, 51, 2012},
            {LocalDate.of(2012, 12, 24), DayOfWeek.MONDAY, 52, 2012},
            {LocalDate.of(2012, 12, 27), DayOfWeek.THURSDAY, 52, 2012},
            {LocalDate.of(2012, 12, 28), DayOfWeek.FRIDAY, 52, 2012},
            {LocalDate.of(2012, 12, 29), DayOfWeek.SATURDAY, 52, 2012},
            {LocalDate.of(2012, 12, 30), DayOfWeek.SUNDAY, 52, 2012},
            {LocalDate.of(2012, 12, 31), DayOfWeek.MONDAY, 1, 2013},
            {LocalDate.of(2013, 1, 1), DayOfWeek.TUESDAY, 1, 2013},
            {LocalDate.of(2013, 1, 2), DayOfWeek.WEDNESDAY, 1, 2013},
            {LocalDate.of(2013, 1, 6), DayOfWeek.SUNDAY, 1, 2013},
            {LocalDate.of(2013, 1, 7), DayOfWeek.MONDAY, 2, 2013},
    };
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:17,代码来源:TCKWeekFields.java

示例2: demo2_API

public static void demo2_API() {
    Traffic api = new TrafficImpl(Month.APRIL, DayOfWeek.FRIDAY, 17, "USA", "Denver", "Main103S");
    double timeSec = 10.0;
    int trafficUnitsNumber = 10;
    api.speedAfterStart(timeSec, trafficUnitsNumber);

    SpeedModel speedModel =  (t, wp, hp) -> {
        double weightPower = 2.0 * hp * 746 * 32.174 / wp;
        return Math.round(Math.sqrt(t * weightPower) * 0.68);
    };
    api.speedAfterStart(timeSec, trafficUnitsNumber, speedModel);

    Predicate<TrafficUnit> limitTraffic = tu ->
            (tu.getHorsePower() < 250 && tu.getVehicleType() == Vehicle.VehicleType.CAR)
                    || (tu.getHorsePower() < 400 && tu.getVehicleType() == Vehicle.VehicleType.TRUCK);

    Predicate<TrafficUnit> limitTraffic2 = tu ->
            tu.getRoadCondition() == RoadCondition.WET
                    && tu.getTireCondition() == SpeedModel.TireCondition.NEW
                    && tu.getTemperature() > 65;

    api.speedAfterStart(timeSec, trafficUnitsNumber, speedModel, limitTraffic);

    BiPredicate<TrafficUnit, Double> limitTrafficAndSpeed = (tu, sp) ->
            (sp > (tu.getSpeedLimitMph() + 8.0) && tu.getRoadCondition() == RoadCondition.DRY)
                    || (sp > (tu.getSpeedLimitMph() + 5.0) && tu.getRoadCondition() == RoadCondition.WET)
                    || (sp > (tu.getSpeedLimitMph() + 0.0) && tu.getRoadCondition() == RoadCondition.SNOW);

    api.speedAfterStart(timeSec, trafficUnitsNumber, speedModel, limitTrafficAndSpeed);

    BiConsumer<TrafficUnit, Double> printResults = (tm, sp) ->
            System.out.println("Road " + tm.getRoadCondition() + ", tires " + tm.getTireCondition()
                    + ": " + tm.getVehicleType().getType() + " speedMph (" + timeSec + " sec)=" + sp + " mph");

    api.speedAfterStart(timeSec, trafficUnitsNumber, speedModel, limitTrafficAndSpeed, printResults);
}
 
开发者ID:PacktPublishing,项目名称:Java-9-Cookbook,代码行数:36,代码来源:Chapter04Functional.java

示例3: testOnGetLongDayOfWeek

@Test
public void testOnGetLongDayOfWeek() {
    PersianDate pd = PersianDate.of(1387, 12, 30);
    DayOfWeek dow = DayOfWeek.FRIDAY;
    // Check about three years
    for (int i = 0; i < 1000; i++) {
        assertEquals(dow.getValue(), pd.getLong(DAY_OF_WEEK));
        pd = pd.plusDays(1);
        dow = dow.plus(1);
    }
}
 
开发者ID:mfathi91,项目名称:persian-date-time,代码行数:11,代码来源:PersianDateTest.java

示例4: data_query

@DataProvider(name="query")
Object[][] data_query() {
    return new Object[][] {
            {DayOfWeek.FRIDAY, TemporalQueries.chronology(), null},
            {DayOfWeek.FRIDAY, TemporalQueries.zoneId(), null},
            {DayOfWeek.FRIDAY, TemporalQueries.precision(), ChronoUnit.DAYS},
            {DayOfWeek.FRIDAY, TemporalQueries.zone(), null},
            {DayOfWeek.FRIDAY, TemporalQueries.offset(), null},
            {DayOfWeek.FRIDAY, TemporalQueries.localDate(), null},
            {DayOfWeek.FRIDAY, TemporalQueries.localTime(), null},
    };
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:12,代码来源:TCKDayOfWeek.java

示例5: checkHarvestedCrops

@SubscribeEvent
public void checkHarvestedCrops(BlockEvent.HarvestDropsEvent event) {
	
	Block crop = event.getState().getBlock();
	if (event.getHarvester() != null && event.getHarvester().capabilities.isCreativeMode)
		return;
	
	if (crop == UCBlocks.cropInvisibilia) {
		if (event.getHarvester() == null) 
		{
			event.getDrops().clear();
			event.setResult(Result.DEFAULT);
		}
	}
	if (crop == UCBlocks.cropFeroxia && ((Feroxia)crop).isFullyGrown(event.getWorld(), event.getPos(), event.getState())) {
		if (event.getHarvester() != null && !(event.getHarvester() instanceof FakePlayer))
			GrowthSteps.generateSteps(event.getHarvester());
		else
			event.getDrops().clear();
		event.setResult(Result.DEFAULT);
	}
	if (crop == UCBlocks.cropDyeius && !event.getDrops().isEmpty()) {
		for (ItemStack stack : event.getDrops()) {
			if (stack.getItem() == Items.DYE)
			{
				long time = event.getWorld().getWorldTime() % 24000L;
				int meta = (int)(time / 1500);
				LocalDateTime current = LocalDateTime.now();
				if (current.getDayOfWeek() == DayOfWeek.FRIDAY)
					stack.setItemDamage(EnumDyeColor.byMetadata(meta).getMetadata());
				else
					stack.setItemDamage(EnumDyeColor.byMetadata(meta).getDyeDamage());
			}
		}
	}
}
 
开发者ID:bafomdad,项目名称:uniquecrops,代码行数:36,代码来源:UCEventHandlerServer.java

示例6: createTask

private static AverageSpeed createTask(){
    DateLocation dateLocation = new DateLocation(Month.APRIL, DayOfWeek.FRIDAY, 17, "USA", "Denver", "Main103S");
    return new AverageSpeed(dateLocation, 10, 1001, 100);
}
 
开发者ID:PacktPublishing,项目名称:Java-9-Cookbook,代码行数:4,代码来源:Chapter07Concurrency04.java

示例7: setup

@Before
public void setup() {

    // Create shifts
    Shift shift0 = new Shift(0, DayOfWeek.MONDAY, LocalTime.of(16, 45), LocalTime.of(19, 45));
    Shift shift1 = new Shift(1, DayOfWeek.TUESDAY, LocalTime.of(18, 0), LocalTime.of(21, 0));
    Shift shift2 = new Shift(2, DayOfWeek.WEDNESDAY, LocalTime.of(19, 0), LocalTime.of(21, 0));
    Shift shift3 = new Shift(3, DayOfWeek.THURSDAY, LocalTime.of(18, 30), LocalTime.of(21, 30));
    Shift shift4 = new Shift(4, DayOfWeek.FRIDAY, LocalTime.of(17, 15), LocalTime.of(20, 45));
    this.shifts.add(shift0);
    this.shifts.add(shift1);
    this.shifts.add(shift2);
    this.shifts.add(shift3);
    this.shifts.add(shift4);

    // Required shifts for courses
    Set<Shift> shiftSet0 = new HashSet<>();
    shiftSet0.add(shift0);
    Set<Shift> shiftSet1 = new HashSet<>();
    shiftSet1.add(shift1);
    shiftSet1.add(shift4);
    Set<Shift> shiftSet2 = new HashSet<>();
    shiftSet2.add(shift1);
    shiftSet2.add(shift2);
    shiftSet2.add(shift3);
    Set<Shift> shiftSet3 = new HashSet<>();
    shiftSet3.add(shift0);
    shiftSet3.add(shift2);
    shiftSet3.add(shift3);
    shiftSet3.add(shift4);

    // Create courses
    Course course0 = new Course(0, "CS 301", new CourseRequirements(shiftSet1, 1, 3, CourseIntensity.MEDIUM, null, 0));
    Course course1 = new Course(1, "CS 302", new CourseRequirements(shiftSet2, 2, 2, CourseIntensity.HIGH, null, 0));
    Course course2 = new Course(2, "CS 577", new CourseRequirements(shiftSet0, 1, 2, CourseIntensity.LOW, null, 0));
    Course course3 = new Course(3, "EMA 201", new CourseRequirements(shiftSet3, 4, 4, CourseIntensity.HIGH, null, 0));
    Course course4 = new Course(4, "ECE 210", new CourseRequirements(shiftSet0, 1, 1, CourseIntensity.LOW, null, 0));
    this.courses.add(course0);
    this.courses.add(course1);
    this.courses.add(course2);
    this.courses.add(course3);
    this.courses.add(course4);
}
 
开发者ID:cocolocomoco21,项目名称:ULCRS,代码行数:43,代码来源:TutorTest.java


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