Package com.asakusafw.runtime.value

Examples of com.asakusafw.runtime.value.DateTime


            all.set("c_long", 100000L);
            all.set("c_float", 1.5f);
            all.set("c_double", 2.5f);
            all.set("c_decimal", new BigDecimal("3.1415"));
            all.set("c_date", new Date(2011, 9, 1));
            all.set("c_datetime", new DateTime(2011, 12, 31, 23, 59, 59));
            p.setParameters(all.unwrap());
            ps.executeUpdate();

            ps.close();
View Full Code Here


        all.set("c_long", 100000L);
        all.set("c_float", 1.5f);
        all.set("c_double", 2.5f);
        all.set("c_decimal", new BigDecimal("3.1415"));
        all.set("c_date", new Date(2011, 9, 1));
        all.set("c_datetime", new DateTime(2011, 12, 31, 23, 59, 59));

        DataModelStreamSupport<Object> unsafe = unsafe(support);

        ByteArrayOutputStream output = new ByteArrayOutputStream();
        DataModelWriter<Object> writer = unsafe.createWriter("hello", output);
View Full Code Here

        ModelWrapper model = loaded.newModel("Model");
        model.set("text_value", new Text("\u3042\u3044\u3046\u3048\u304a"));
        model.set("true_value", true);
        model.set("false_value", false);
        model.set("date_value", new Date(2011, 10, 11));
        model.set("date_time_value", new DateTime(2011, 1, 2, 13, 14, 15));
        DataModelStreamSupport<Object> support = unsafe(loaded.newObject("csv", "ModelCsvSupport"));

        ByteArrayOutputStream output = new ByteArrayOutputStream();
        DataModelWriter<Object> writer = support.createWriter("hello", output);
        writer.write(model.unwrap());
View Full Code Here

        obj.intOption.modify(3);
        obj.longOption.modify(4L);
        obj.floatOption.modify(5f);
        obj.doubleOption.modify(6d);
        obj.dateOption.modify(new Date(2014, 6, 1));
        obj.dateTimeOption.modify(new DateTime(2014, 6, 1, 2, 3, 4));
        obj.stringOption.modify("Hello, world!");
        obj.decimalOption.modify(new BigDecimal("7.8"));

        DataModelInspector inspector = new DataModelInspector(descriptor);
        assertThat(inspector.getTypeName(), is(MockTypes.class.getName()));
View Full Code Here

        copy.intOption.modify(3);
        copy.longOption.modify(4L);
        copy.floatOption.modify(5f);
        copy.doubleOption.modify(6d);
        copy.dateOption.modify(new Date(2014, 6, 1));
        copy.dateTimeOption.modify(new DateTime(2014, 6, 1, 2, 3, 4));
        copy.stringOption.modify("Hello, world!");
        copy.decimalOption.modify(new BigDecimal("7.8"));

        driver.set(copy, obj);
View Full Code Here

        in.intOption.modify(3);
        in.longOption.modify(4L);
        in.floatOption.modify(5f);
        in.doubleOption.modify(6d);
        in.dateOption.modify(new Date(2014, 6, 1));
        in.dateTimeOption.modify(new DateTime(2014, 6, 1, 2, 3, 4));
        in.stringOption.modify("Hello, world!");
        in.decimalOption.modify(new BigDecimal("7.8"));

        MockTypes out = restore(format, in);
        assertThat(out.booleanOption, equalTo(in.booleanOption));
View Full Code Here

            in.intOption.modify(3);
            in.longOption.modify(4L);
            in.floatOption.modify(5f);
            in.doubleOption.modify(6d);
            in.dateOption.modify(new Date(2014, 6, 1));
            in.dateTimeOption.modify(new DateTime(2014, 6, 1, 2, 3, 4));
            in.stringOption.modify("Hello, world!");
            in.decimalOption.modify(new BigDecimal("7.8"));
            inputs.add(in);
        }
View Full Code Here

        ParquetFileFormat<WithStringSupports> format = format(WithStringSupports.class, edits);

        WithStringSupports in = new WithStringSupports();
        in.decimal.modify(new BigDecimal("123.45"));
        in.date.modify(new Date(2014, 7, 1));
        in.datetime.modify(new DateTime(2014, 7, 1, 12, 34, 56));

        WithStringSupports out = restore(format, in);
        assertThat(out.decimal, is(in.decimal));
        assertThat(out.date, is(in.date));
        assertThat(out.datetime, is(in.datetime));
View Full Code Here

        List<WithStringSupports> inputs = new ArrayList<WithStringSupports>();
        for (int i = 0; i < count; i++) {
            WithStringSupports object = new WithStringSupports();
            object.decimal.modify(new BigDecimal("123.45"));
            object.date.modify(new Date(2014, 7, 1));
            object.datetime.modify(new DateTime(2014, 7, 1, 12, 34, 56));
            inputs.add(object);
        }
        WithStringSupports sample = inputs.get(0);
        List<WithStringSupports> outputs = restore(format, inputs);
        for (WithStringSupports out : outputs) {
View Full Code Here

    @Test
    public void datetime_by_string() {
        ValueSerde serde = StringValueSerdeFactory.DATETIME;
        StringObjectInspector inspector = (StringObjectInspector) serde.getInspector();

        DateTimeOption option = new DateTimeOption(new DateTime(2014, 7, 1, 12, 5, 59));
        String value = "2014-07-01 12:05:59";

        assertThat(inspector.copyObject(option), is((Object) option));
        assertThat(inspector.copyObject(option), is(not(sameInstance((Object) option))));
        assertThat(inspector.copyObject(null), is(nullValue()));
View Full Code Here

TOP

Related Classes of com.asakusafw.runtime.value.DateTime

Copyright © 2018 www.massapicom. 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.