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


Java GregorianChronology.getInstanceUTC方法代码示例

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


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

示例1: testIsBefore_LocalDate

import org.joda.time.chrono.GregorianChronology; //导入方法依赖的package包/类
public void testIsBefore_LocalDate() {
    LocalDate test1 = new LocalDate(2005, 6, 2);
    LocalDate test1a = new LocalDate(2005, 6, 2);
    assertEquals(false, test1.isBefore(test1a));
    assertEquals(false, test1a.isBefore(test1));
    assertEquals(false, test1.isBefore(test1));
    assertEquals(false, test1a.isBefore(test1a));
    
    LocalDate test2 = new LocalDate(2005, 7, 2);
    assertEquals(true, test1.isBefore(test2));
    assertEquals(false, test2.isBefore(test1));
    
    LocalDate test3 = new LocalDate(2005, 7, 2, GregorianChronology.getInstanceUTC());
    assertEquals(true, test1.isBefore(test3));
    assertEquals(false, test3.isBefore(test1));
    assertEquals(false, test3.isBefore(test2));
    
    try {
        new LocalDate(2005, 7, 2).isBefore(null);
        fail();
    } catch (IllegalArgumentException ex) {}
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:23,代码来源:TestLocalDate_Basics.java

示例2: testIsAfter_LocalTime

import org.joda.time.chrono.GregorianChronology; //导入方法依赖的package包/类
public void testIsAfter_LocalTime() {
    LocalTime test1 = new LocalTime(10, 20, 30, 40);
    LocalTime test1a = new LocalTime(10, 20, 30, 40);
    assertEquals(false, test1.isAfter(test1a));
    assertEquals(false, test1a.isAfter(test1));
    assertEquals(false, test1.isAfter(test1));
    assertEquals(false, test1a.isAfter(test1a));
    
    LocalTime test2 = new LocalTime(10, 20, 35, 40);
    assertEquals(false, test1.isAfter(test2));
    assertEquals(true, test2.isAfter(test1));
    
    LocalTime test3 = new LocalTime(10, 20, 35, 40, GregorianChronology.getInstanceUTC());
    assertEquals(false, test1.isAfter(test3));
    assertEquals(true, test3.isAfter(test1));
    assertEquals(false, test3.isAfter(test2));
    
    try {
        new LocalTime(10, 20, 35, 40).isAfter(null);
        fail();
    } catch (IllegalArgumentException ex) {}
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:23,代码来源:TestLocalTime_Basics.java

示例3: testIsAfter_LocalDate

import org.joda.time.chrono.GregorianChronology; //导入方法依赖的package包/类
public void testIsAfter_LocalDate() {
    LocalDate test1 = new LocalDate(2005, 6, 2);
    LocalDate test1a = new LocalDate(2005, 6, 2);
    assertEquals(false, test1.isAfter(test1a));
    assertEquals(false, test1a.isAfter(test1));
    assertEquals(false, test1.isAfter(test1));
    assertEquals(false, test1a.isAfter(test1a));
    
    LocalDate test2 = new LocalDate(2005, 7, 2);
    assertEquals(false, test1.isAfter(test2));
    assertEquals(true, test2.isAfter(test1));
    
    LocalDate test3 = new LocalDate(2005, 7, 2, GregorianChronology.getInstanceUTC());
    assertEquals(false, test1.isAfter(test3));
    assertEquals(true, test3.isAfter(test1));
    assertEquals(false, test3.isAfter(test2));
    
    try {
        new LocalDate(2005, 7, 2).isAfter(null);
        fail();
    } catch (IllegalArgumentException ex) {}
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:23,代码来源:TestLocalDate_Basics.java

示例4: testIsEqual_YM

import org.joda.time.chrono.GregorianChronology; //导入方法依赖的package包/类
public void testIsEqual_YM() {
    YearMonth test1 = new YearMonth(2005, 6);
    YearMonth test1a = new YearMonth(2005, 6);
    assertEquals(true, test1.isEqual(test1a));
    assertEquals(true, test1a.isEqual(test1));
    assertEquals(true, test1.isEqual(test1));
    assertEquals(true, test1a.isEqual(test1a));
    
    YearMonth test2 = new YearMonth(2005, 7);
    assertEquals(false, test1.isEqual(test2));
    assertEquals(false, test2.isEqual(test1));
    
    YearMonth test3 = new YearMonth(2005, 7, GregorianChronology.getInstanceUTC());
    assertEquals(false, test1.isEqual(test3));
    assertEquals(false, test3.isEqual(test1));
    assertEquals(true, test3.isEqual(test2));
    
    try {
        new YearMonth(2005, 7).isEqual(null);
        fail();
    } catch (IllegalArgumentException ex) {}
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:23,代码来源:TestYearMonth_Basics.java

示例5: testIsAfter_YMD

import org.joda.time.chrono.GregorianChronology; //导入方法依赖的package包/类
public void testIsAfter_YMD() {
    YearMonthDay test1 = new YearMonthDay(2005, 6, 2);
    YearMonthDay test1a = new YearMonthDay(2005, 6, 2);
    assertEquals(false, test1.isAfter(test1a));
    assertEquals(false, test1a.isAfter(test1));
    assertEquals(false, test1.isAfter(test1));
    assertEquals(false, test1a.isAfter(test1a));
    
    YearMonthDay test2 = new YearMonthDay(2005, 7, 2);
    assertEquals(false, test1.isAfter(test2));
    assertEquals(true, test2.isAfter(test1));
    
    YearMonthDay test3 = new YearMonthDay(2005, 7, 2, GregorianChronology.getInstanceUTC());
    assertEquals(false, test1.isAfter(test3));
    assertEquals(true, test3.isAfter(test1));
    assertEquals(false, test3.isAfter(test2));
    
    try {
        new YearMonthDay(2005, 7, 2).isAfter(null);
        fail();
    } catch (IllegalArgumentException ex) {}
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:23,代码来源:TestYearMonthDay_Basics.java

示例6: testIsAfter_YM

import org.joda.time.chrono.GregorianChronology; //导入方法依赖的package包/类
public void testIsAfter_YM() {
    YearMonth test1 = new YearMonth(2005, 6);
    YearMonth test1a = new YearMonth(2005, 6);
    assertEquals(false, test1.isAfter(test1a));
    assertEquals(false, test1a.isAfter(test1));
    assertEquals(false, test1.isAfter(test1));
    assertEquals(false, test1a.isAfter(test1a));
    
    YearMonth test2 = new YearMonth(2005, 7);
    assertEquals(false, test1.isAfter(test2));
    assertEquals(true, test2.isAfter(test1));
    
    YearMonth test3 = new YearMonth(2005, 7, GregorianChronology.getInstanceUTC());
    assertEquals(false, test1.isAfter(test3));
    assertEquals(true, test3.isAfter(test1));
    assertEquals(false, test3.isAfter(test2));
    
    try {
        new YearMonth(2005, 7).isAfter(null);
        fail();
    } catch (IllegalArgumentException ex) {}
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:23,代码来源:TestYearMonth_Basics.java

示例7: testIsAfter_TOD

import org.joda.time.chrono.GregorianChronology; //导入方法依赖的package包/类
public void testIsAfter_TOD() {
    TimeOfDay test1 = new TimeOfDay(10, 20, 30, 40);
    TimeOfDay test1a = new TimeOfDay(10, 20, 30, 40);
    assertEquals(false, test1.isAfter(test1a));
    assertEquals(false, test1a.isAfter(test1));
    assertEquals(false, test1.isAfter(test1));
    assertEquals(false, test1a.isAfter(test1a));
    
    TimeOfDay test2 = new TimeOfDay(10, 20, 35, 40);
    assertEquals(false, test1.isAfter(test2));
    assertEquals(true, test2.isAfter(test1));
    
    TimeOfDay test3 = new TimeOfDay(10, 20, 35, 40, GregorianChronology.getInstanceUTC());
    assertEquals(false, test1.isAfter(test3));
    assertEquals(true, test3.isAfter(test1));
    assertEquals(false, test3.isAfter(test2));
    
    try {
        new TimeOfDay(10, 20, 35, 40).isAfter(null);
        fail();
    } catch (IllegalArgumentException ex) {}
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:23,代码来源:TestTimeOfDay_Basics.java

示例8: testIsBefore_YM

import org.joda.time.chrono.GregorianChronology; //导入方法依赖的package包/类
public void testIsBefore_YM() {
    YearMonth test1 = new YearMonth(2005, 6);
    YearMonth test1a = new YearMonth(2005, 6);
    assertEquals(false, test1.isBefore(test1a));
    assertEquals(false, test1a.isBefore(test1));
    assertEquals(false, test1.isBefore(test1));
    assertEquals(false, test1a.isBefore(test1a));
    
    YearMonth test2 = new YearMonth(2005, 7);
    assertEquals(true, test1.isBefore(test2));
    assertEquals(false, test2.isBefore(test1));
    
    YearMonth test3 = new YearMonth(2005, 7, GregorianChronology.getInstanceUTC());
    assertEquals(true, test1.isBefore(test3));
    assertEquals(false, test3.isBefore(test1));
    assertEquals(false, test3.isBefore(test2));
    
    try {
        new YearMonth(2005, 7).isBefore(null);
        fail();
    } catch (IllegalArgumentException ex) {}
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:23,代码来源:TestYearMonth_Basics.java

示例9: testIsBefore_YMD

import org.joda.time.chrono.GregorianChronology; //导入方法依赖的package包/类
public void testIsBefore_YMD() {
    YearMonthDay test1 = new YearMonthDay(2005, 6, 2);
    YearMonthDay test1a = new YearMonthDay(2005, 6, 2);
    assertEquals(false, test1.isBefore(test1a));
    assertEquals(false, test1a.isBefore(test1));
    assertEquals(false, test1.isBefore(test1));
    assertEquals(false, test1a.isBefore(test1a));
    
    YearMonthDay test2 = new YearMonthDay(2005, 7, 2);
    assertEquals(true, test1.isBefore(test2));
    assertEquals(false, test2.isBefore(test1));
    
    YearMonthDay test3 = new YearMonthDay(2005, 7, 2, GregorianChronology.getInstanceUTC());
    assertEquals(true, test1.isBefore(test3));
    assertEquals(false, test3.isBefore(test1));
    assertEquals(false, test3.isBefore(test2));
    
    try {
        new YearMonthDay(2005, 7, 2).isBefore(null);
        fail();
    } catch (IllegalArgumentException ex) {}
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:23,代码来源:TestYearMonthDay_Basics.java

示例10: testIsEqual_YMD

import org.joda.time.chrono.GregorianChronology; //导入方法依赖的package包/类
public void testIsEqual_YMD() {
    YearMonthDay test1 = new YearMonthDay(2005, 6, 2);
    YearMonthDay test1a = new YearMonthDay(2005, 6, 2);
    assertEquals(true, test1.isEqual(test1a));
    assertEquals(true, test1a.isEqual(test1));
    assertEquals(true, test1.isEqual(test1));
    assertEquals(true, test1a.isEqual(test1a));
    
    YearMonthDay test2 = new YearMonthDay(2005, 7, 2);
    assertEquals(false, test1.isEqual(test2));
    assertEquals(false, test2.isEqual(test1));
    
    YearMonthDay test3 = new YearMonthDay(2005, 7, 2, GregorianChronology.getInstanceUTC());
    assertEquals(false, test1.isEqual(test3));
    assertEquals(false, test3.isEqual(test1));
    assertEquals(true, test3.isEqual(test2));
    
    try {
        new YearMonthDay(2005, 7, 2).isEqual(null);
        fail();
    } catch (IllegalArgumentException ex) {}
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:23,代码来源:TestYearMonthDay_Basics.java

示例11: testIsEqual_LocalTime

import org.joda.time.chrono.GregorianChronology; //导入方法依赖的package包/类
public void testIsEqual_LocalTime() {
    LocalTime test1 = new LocalTime(10, 20, 30, 40);
    LocalTime test1a = new LocalTime(10, 20, 30, 40);
    assertEquals(true, test1.isEqual(test1a));
    assertEquals(true, test1a.isEqual(test1));
    assertEquals(true, test1.isEqual(test1));
    assertEquals(true, test1a.isEqual(test1a));
    
    LocalTime test2 = new LocalTime(10, 20, 35, 40);
    assertEquals(false, test1.isEqual(test2));
    assertEquals(false, test2.isEqual(test1));
    
    LocalTime test3 = new LocalTime(10, 20, 35, 40, GregorianChronology.getInstanceUTC());
    assertEquals(false, test1.isEqual(test3));
    assertEquals(false, test3.isEqual(test1));
    assertEquals(true, test3.isEqual(test2));
    
    try {
        new LocalTime(10, 20, 35, 40).isEqual(null);
        fail();
    } catch (IllegalArgumentException ex) {}
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:23,代码来源:TestLocalTime_Basics.java

示例12: testIsBefore_LocalTime

import org.joda.time.chrono.GregorianChronology; //导入方法依赖的package包/类
public void testIsBefore_LocalTime() {
    LocalTime test1 = new LocalTime(10, 20, 30, 40);
    LocalTime test1a = new LocalTime(10, 20, 30, 40);
    assertEquals(false, test1.isBefore(test1a));
    assertEquals(false, test1a.isBefore(test1));
    assertEquals(false, test1.isBefore(test1));
    assertEquals(false, test1a.isBefore(test1a));
    
    LocalTime test2 = new LocalTime(10, 20, 35, 40);
    assertEquals(true, test1.isBefore(test2));
    assertEquals(false, test2.isBefore(test1));
    
    LocalTime test3 = new LocalTime(10, 20, 35, 40, GregorianChronology.getInstanceUTC());
    assertEquals(true, test1.isBefore(test3));
    assertEquals(false, test3.isBefore(test1));
    assertEquals(false, test3.isBefore(test2));
    
    try {
        new LocalTime(10, 20, 35, 40).isBefore(null);
        fail();
    } catch (IllegalArgumentException ex) {}
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:23,代码来源:TestLocalTime_Basics.java

示例13: testCompareTo

import org.joda.time.chrono.GregorianChronology; //导入方法依赖的package包/类
public void testCompareTo() {
        TimeOfDay test1 = new TimeOfDay(10, 20, 30, 40);
        TimeOfDay test1a = new TimeOfDay(10, 20, 30, 40);
        assertEquals(0, test1.compareTo(test1a));
        assertEquals(0, test1a.compareTo(test1));
        assertEquals(0, test1.compareTo(test1));
        assertEquals(0, test1a.compareTo(test1a));
        
        TimeOfDay test2 = new TimeOfDay(10, 20, 35, 40);
        assertEquals(-1, test1.compareTo(test2));
        assertEquals(+1, test2.compareTo(test1));
        
        TimeOfDay test3 = new TimeOfDay(10, 20, 35, 40, GregorianChronology.getInstanceUTC());
        assertEquals(-1, test1.compareTo(test3));
        assertEquals(+1, test3.compareTo(test1));
        assertEquals(0, test3.compareTo(test2));
        
        DateTimeFieldType[] types = new DateTimeFieldType[] {
            DateTimeFieldType.hourOfDay(),
            DateTimeFieldType.minuteOfHour(),
            DateTimeFieldType.secondOfMinute(),
            DateTimeFieldType.millisOfSecond(),
        };
        int[] values = new int[] {10, 20, 30, 40};
        Partial p = new Partial(types, values);
        assertEquals(0, test1.compareTo(p));
        try {
            test1.compareTo(null);
            fail();
        } catch (NullPointerException ex) {}
//        try {
//            test1.compareTo(new Date());
//            fail();
//        } catch (ClassCastException ex) {}
    }
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:36,代码来源:TestTimeOfDay_Basics.java

示例14: MainTest

import org.joda.time.chrono.GregorianChronology; //导入方法依赖的package包/类
/**
 * @param iterations number of test iterations to perform
 * @param mode GREGORIAN_MODE or JULIAN_MODE,0=Gregorian, 1=Julian
 * @param seed seed for random number generator
 */
public MainTest(int iterations, int mode, long seed) {
    super("testChronology");
    iIterations = iterations;
    iMode = mode;
    iSeed = seed;
    if (mode == GREGORIAN_MODE) {
        iTest = new TestGregorianChronology();
        iActual = GregorianChronology.getInstanceUTC();
    } else {
        iTest = new TestJulianChronology();
        iActual = JulianChronology.getInstanceUTC();
    }
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:19,代码来源:MainTest.java


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