Examples of parser()


Examples of org.elasticsearch.common.joda.FormatDateTimeFormatter.parser()

    }

    @Test public void testMultipleFormats() {
        FormatDateTimeFormatter formatter = Joda.forPattern("yyyy/MM/dd HH:mm:ss||yyyy/MM/dd");
        long millis = formatter.parser().parseMillis("1970/01/01 00:00:00");
        millis = formatter.parser().parseMillis("1970/01/01");
//        System.out.println("" + millis);

        System.out.println(formatter.printer().print(millis));
    }
View Full Code Here

Examples of org.elasticsearch.common.joda.FormatDateTimeFormatter.parser()

        formatter = DateTimeFormat.forPattern("yyyy/MM/dd HH:mm:ss").withZone(DateTimeZone.UTC);
        millis = formatter.parseMillis("1970/01/01 00:00:00");
        assertThat(millis, equalTo(0l));

        FormatDateTimeFormatter formatter2 = Joda.forPattern("yyyy/MM/dd HH:mm:ss");
        millis = formatter2.parser().parseMillis("1970/01/01 00:00:00");
        assertThat(millis, equalTo(0l));
    }

    @Test
    public void testWriteAndParse() {
View Full Code Here

Examples of org.elasticsearch.common.joda.FormatDateTimeFormatter.parser()

    }

    @Test
    public void testSlashInFormat() {
        FormatDateTimeFormatter formatter = Joda.forPattern("MM/yyyy");
        formatter.parser().parseMillis("01/2001");

        formatter = Joda.forPattern("yyyy/MM/dd HH:mm:ss");
        long millis = formatter.parser().parseMillis("1970/01/01 00:00:00");
        formatter.printer().print(millis);
View Full Code Here

Examples of org.elasticsearch.common.joda.FormatDateTimeFormatter.parser()

    public void testSlashInFormat() {
        FormatDateTimeFormatter formatter = Joda.forPattern("MM/yyyy");
        formatter.parser().parseMillis("01/2001");

        formatter = Joda.forPattern("yyyy/MM/dd HH:mm:ss");
        long millis = formatter.parser().parseMillis("1970/01/01 00:00:00");
        formatter.printer().print(millis);

        try {
            millis = formatter.parser().parseMillis("1970/01/01");
            fail();
View Full Code Here

Examples of org.elasticsearch.common.joda.FormatDateTimeFormatter.parser()

        formatter = Joda.forPattern("yyyy/MM/dd HH:mm:ss");
        long millis = formatter.parser().parseMillis("1970/01/01 00:00:00");
        formatter.printer().print(millis);

        try {
            millis = formatter.parser().parseMillis("1970/01/01");
            fail();
        } catch (IllegalArgumentException e) {
            // it really can't parse this one
        }
    }
View Full Code Here

Examples of org.elasticsearch.common.joda.FormatDateTimeFormatter.parser()

    }

    @Test
    public void testMultipleFormats() {
        FormatDateTimeFormatter formatter = Joda.forPattern("yyyy/MM/dd HH:mm:ss||yyyy/MM/dd");
        long millis = formatter.parser().parseMillis("1970/01/01 00:00:00");
        assertThat("1970/01/01 00:00:00", is(formatter.printer().print(millis)));
    }

    @Test
    public void testMultipleDifferentFormats() {
View Full Code Here

Examples of org.elasticsearch.common.joda.FormatDateTimeFormatter.parser()

    @Test
    public void testMultipleDifferentFormats() {
        FormatDateTimeFormatter formatter = Joda.forPattern("yyyy/MM/dd HH:mm:ss||yyyy/MM/dd");
        String input = "1970/01/01 00:00:00";
        long millis = formatter.parser().parseMillis(input);
        assertThat(input, is(formatter.printer().print(millis)));

        Joda.forPattern("yyyy/MM/dd HH:mm:ss||yyyy/MM/dd||dateOptionalTime");
        Joda.forPattern("dateOptionalTime||yyyy/MM/dd HH:mm:ss||yyyy/MM/dd");
        Joda.forPattern("yyyy/MM/dd HH:mm:ss||dateOptionalTime||yyyy/MM/dd");
View Full Code Here

Examples of ptolemy.data.expr.XMLParser.parser()

     @param init The initialization string.
     *  @exception Exception If the string is not parsable.
     */
    public XMLToken(String init) throws Exception {
        XMLParser parser = new XMLParser();
        _doc = parser.parser(init);
        _toString = init;
    }

    ///////////////////////////////////////////////////////////////////
    ////                         public methods                    ////
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.