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


Java PeriodType.yearWeekDayTime方法代碼示例

本文整理匯總了Java中org.joda.time.PeriodType.yearWeekDayTime方法的典型用法代碼示例。如果您正苦於以下問題:Java PeriodType.yearWeekDayTime方法的具體用法?Java PeriodType.yearWeekDayTime怎麽用?Java PeriodType.yearWeekDayTime使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.joda.time.PeriodType的用法示例。


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

示例1: testSetIntoPeriod_Object2

import org.joda.time.PeriodType; //導入方法依賴的package包/類
public void testSetIntoPeriod_Object2() throws Exception {
    MutablePeriod m = new MutablePeriod(PeriodType.yearWeekDayTime());
    StringConverter.INSTANCE.setInto(m, "P2Y4W3DT12H24M48S", null);
    assertEquals(2, m.getYears());
    assertEquals(4, m.getWeeks());
    assertEquals(3, m.getDays());
    assertEquals(12, m.getHours());
    assertEquals(24, m.getMinutes());
    assertEquals(48, m.getSeconds());
    assertEquals(0, m.getMillis());
}
 
開發者ID:SpoonLabs,項目名稱:astor,代碼行數:12,代碼來源:TestStringConverter.java

示例2: testSetIntoPeriod_Object3

import org.joda.time.PeriodType; //導入方法依賴的package包/類
public void testSetIntoPeriod_Object3() throws Exception {
    MutablePeriod m = new MutablePeriod(PeriodType.yearWeekDayTime());
    StringConverter.INSTANCE.setInto(m, "P2Y4W3DT12H24M48.034S", null);
    assertEquals(2, m.getYears());
    assertEquals(4, m.getWeeks());
    assertEquals(3, m.getDays());
    assertEquals(12, m.getHours());
    assertEquals(24, m.getMinutes());
    assertEquals(48, m.getSeconds());
    assertEquals(34, m.getMillis());
}
 
開發者ID:SpoonLabs,項目名稱:astor,代碼行數:12,代碼來源:TestStringConverter.java

示例3: testSetIntoPeriod_Object4

import org.joda.time.PeriodType; //導入方法依賴的package包/類
public void testSetIntoPeriod_Object4() throws Exception {
    MutablePeriod m = new MutablePeriod(PeriodType.yearWeekDayTime());
    StringConverter.INSTANCE.setInto(m, "P2Y4W3DT12H24M.056S", null);
    assertEquals(2, m.getYears());
    assertEquals(4, m.getWeeks());
    assertEquals(3, m.getDays());
    assertEquals(12, m.getHours());
    assertEquals(24, m.getMinutes());
    assertEquals(0, m.getSeconds());
    assertEquals(56, m.getMillis());
}
 
開發者ID:SpoonLabs,項目名稱:astor,代碼行數:12,代碼來源:TestStringConverter.java

示例4: testSetIntoPeriod_Object5

import org.joda.time.PeriodType; //導入方法依賴的package包/類
public void testSetIntoPeriod_Object5() throws Exception {
    MutablePeriod m = new MutablePeriod(PeriodType.yearWeekDayTime());
    StringConverter.INSTANCE.setInto(m, "P2Y4W3DT12H24M56.S", null);
    assertEquals(2, m.getYears());
    assertEquals(4, m.getWeeks());
    assertEquals(3, m.getDays());
    assertEquals(12, m.getHours());
    assertEquals(24, m.getMinutes());
    assertEquals(56, m.getSeconds());
    assertEquals(0, m.getMillis());
}
 
開發者ID:SpoonLabs,項目名稱:astor,代碼行數:12,代碼來源:TestStringConverter.java

示例5: testSetIntoPeriod_Object6

import org.joda.time.PeriodType; //導入方法依賴的package包/類
public void testSetIntoPeriod_Object6() throws Exception {
    MutablePeriod m = new MutablePeriod(PeriodType.yearWeekDayTime());
    StringConverter.INSTANCE.setInto(m, "P2Y4W3DT12H24M56.1234567S", null);
    assertEquals(2, m.getYears());
    assertEquals(4, m.getWeeks());
    assertEquals(3, m.getDays());
    assertEquals(12, m.getHours());
    assertEquals(24, m.getMinutes());
    assertEquals(56, m.getSeconds());
    assertEquals(123, m.getMillis());
}
 
開發者ID:SpoonLabs,項目名稱:astor,代碼行數:12,代碼來源:TestStringConverter.java

示例6: testSetIntoPeriod_Object7

import org.joda.time.PeriodType; //導入方法依賴的package包/類
public void testSetIntoPeriod_Object7() throws Exception {
    MutablePeriod m = new MutablePeriod(1, 0, 1, 1, 1, 1, 1, 1, PeriodType.yearWeekDayTime());
    StringConverter.INSTANCE.setInto(m, "P2Y4W3D", null);
    assertEquals(2, m.getYears());
    assertEquals(4, m.getWeeks());
    assertEquals(3, m.getDays());
    assertEquals(0, m.getHours());
    assertEquals(0, m.getMinutes());
    assertEquals(0, m.getSeconds());
    assertEquals(0, m.getMillis());
}
 
開發者ID:SpoonLabs,項目名稱:astor,代碼行數:12,代碼來源:TestStringConverter.java


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