當前位置: 首頁>>代碼示例>>Java>>正文


Java MinusAdjuster類代碼示例

本文整理匯總了Java中java.time.calendrical.DateTime.MinusAdjuster的典型用法代碼示例。如果您正苦於以下問題:Java MinusAdjuster類的具體用法?Java MinusAdjuster怎麽用?Java MinusAdjuster使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MinusAdjuster類屬於java.time.calendrical.DateTime包,在下文中一共展示了MinusAdjuster類的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: test_minus_Adjuster

import java.time.calendrical.DateTime.MinusAdjuster; //導入依賴的package包/類
@Test(groups = { "tck" })
public void test_minus_Adjuster() {

  MinusAdjuster p = Period.ofTime(0, 0, 62, 3);
  LocalTime t = this.TEST_12_30_40_987654321.minus(p);
  assertEquals(t, LocalTime.of(12, 29, 38, 987654318));
}
 
開發者ID:m-m-m,項目名稱:java8-backports,代碼行數:8,代碼來源:TCKLocalTime.java

示例2: test_minus_Adjuster_positiveHours

import java.time.calendrical.DateTime.MinusAdjuster; //導入依賴的package包/類
@Test(groups = { "tck" })
public void test_minus_Adjuster_positiveHours() {

  MinusAdjuster period = MockSimplePeriod.of(7, ChronoUnit.HOURS);
  LocalTime t = this.TEST_12_30_40_987654321.minus(period);
  assertEquals(t, LocalTime.of(5, 30, 40, 987654321));
}
 
開發者ID:m-m-m,項目名稱:java8-backports,代碼行數:8,代碼來源:TCKLocalTime.java

示例3: test_minus_Adjuster_negativeMinutes

import java.time.calendrical.DateTime.MinusAdjuster; //導入依賴的package包/類
@Test(groups = { "tck" })
public void test_minus_Adjuster_negativeMinutes() {

  MinusAdjuster period = MockSimplePeriod.of(-25, ChronoUnit.MINUTES);
  LocalTime t = this.TEST_12_30_40_987654321.minus(period);
  assertEquals(t, LocalTime.of(12, 55, 40, 987654321));
}
 
開發者ID:m-m-m,項目名稱:java8-backports,代碼行數:8,代碼來源:TCKLocalTime.java

示例4: test_minus_Adjuster_big1

import java.time.calendrical.DateTime.MinusAdjuster; //導入依賴的package包/類
@Test(groups = { "tck" })
public void test_minus_Adjuster_big1() {

  MinusAdjuster p = Period.ofTime(0, 0, 0, Long.MAX_VALUE);
  LocalTime t = this.TEST_12_30_40_987654321.minus(p);
  assertEquals(t, this.TEST_12_30_40_987654321.minusNanos(Long.MAX_VALUE));
}
 
開發者ID:m-m-m,項目名稱:java8-backports,代碼行數:8,代碼來源:TCKLocalTime.java

示例5: test_minus_Adjuster_zero

import java.time.calendrical.DateTime.MinusAdjuster; //導入依賴的package包/類
@Test(groups = { "tck" })
public void test_minus_Adjuster_zero() {

  MinusAdjuster p = Period.ZERO;
  LocalTime t = this.TEST_12_30_40_987654321.minus(p);
  assertEquals(t, this.TEST_12_30_40_987654321);
}
 
開發者ID:m-m-m,項目名稱:java8-backports,代碼行數:8,代碼來源:TCKLocalTime.java

示例6: test_minus_Adjuster_wrap

import java.time.calendrical.DateTime.MinusAdjuster; //導入依賴的package包/類
@Test(groups = { "tck" })
public void test_minus_Adjuster_wrap() {

  MinusAdjuster p = Period.ofTime(1, 0, 0);
  LocalTime t = LocalTime.of(0, 30).minus(p);
  assertEquals(t, LocalTime.of(23, 30));
}
 
開發者ID:m-m-m,項目名稱:java8-backports,代碼行數:8,代碼來源:TCKLocalTime.java

示例7: test_minus_adjuster_null

import java.time.calendrical.DateTime.MinusAdjuster; //導入依賴的package包/類
@Test(expectedExceptions = NullPointerException.class, groups = { "tck" })
public void test_minus_adjuster_null() {

  this.TEST_DATE_TIME.minus((MinusAdjuster) null);
}
 
開發者ID:m-m-m,項目名稱:java8-backports,代碼行數:6,代碼來源:TCKZonedDateTime.java

示例8: test_minus_adjuster_null

import java.time.calendrical.DateTime.MinusAdjuster; //導入依賴的package包/類
@Test(expectedExceptions = NullPointerException.class, groups = { "tck" })
public void test_minus_adjuster_null() {

  this.TEST_2007_07_15_12_30_40_987654321.minus((MinusAdjuster) null);
}
 
開發者ID:m-m-m,項目名稱:java8-backports,代碼行數:6,代碼來源:TCKLocalDateTime.java

示例9: test_minus_Adjuster_dateNotAllowed

import java.time.calendrical.DateTime.MinusAdjuster; //導入依賴的package包/類
@Test(groups = { "tck" }, expectedExceptions = DateTimeException.class)
public void test_minus_Adjuster_dateNotAllowed() {

  MinusAdjuster period = MockSimplePeriod.of(7, ChronoUnit.MONTHS);
  this.TEST_12_30_40_987654321.minus(period);
}
 
開發者ID:m-m-m,項目名稱:java8-backports,代碼行數:7,代碼來源:TCKLocalTime.java

示例10: test_minus_Adjuster_null

import java.time.calendrical.DateTime.MinusAdjuster; //導入依賴的package包/類
@Test(expectedExceptions = NullPointerException.class, groups = { "tck" })
public void test_minus_Adjuster_null() {

  this.TEST_12_30_40_987654321.minus((MinusAdjuster) null);
}
 
開發者ID:m-m-m,項目名稱:java8-backports,代碼行數:6,代碼來源:TCKLocalTime.java

示例11: test_plus_MinusAdjuster_null

import java.time.calendrical.DateTime.MinusAdjuster; //導入依賴的package包/類
@Test(expectedExceptions = NullPointerException.class, groups = { "tck" })
public void test_plus_MinusAdjuster_null() {

  this.TEST_2007_07_15_PONE.minus((MinusAdjuster) null);
}
 
開發者ID:m-m-m,項目名稱:java8-backports,代碼行數:6,代碼來源:TCKOffsetDate.java

示例12: test_minus_MinusAdjuster_null

import java.time.calendrical.DateTime.MinusAdjuster; //導入依賴的package包/類
@Test(expectedExceptions = NullPointerException.class, groups = { "tck" })
public void test_minus_MinusAdjuster_null() {

  this.TEST_11_30_59_500_PONE.minus((MinusAdjuster) null);
}
 
開發者ID:m-m-m,項目名稱:java8-backports,代碼行數:6,代碼來源:TCKOffsetTime.java


注:本文中的java.time.calendrical.DateTime.MinusAdjuster類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。