Package com.facebook.presto.jdbc.internal.joda.time

Examples of com.facebook.presto.jdbc.internal.joda.time.Period


        Object value = column(columnIndex);
        if (value == null) {
            return null;
        }

        Period period = INTERVAL_YEAR_TO_MONTH_FORMATTER.parsePeriod(String.valueOf(value));
        return new PrestoIntervalYearMonth(
                period.getValue(YEAR_FIELD),
                period.getValue(MONTH_FIELD));
    }
View Full Code Here


        Object value = column(columnIndex);
        if (value == null) {
            return null;
        }

        Period period = INTERVAL_DAY_TO_SECOND_FORMATTER.parsePeriod(String.valueOf(value));
        return new PrestoIntervalDayTime(
                period.getValue(DAY_FIELD),
                period.getValue(HOUR_FIELD),
                period.getValue(MINUTE_FIELD),
                period.getValue(SECOND_FIELD),
                period.getValue(MILLIS_FIELD));
    }
View Full Code Here

    {
        // TODO: perhaps support array of numbers...
        //if (jp.isExpectedStartArrayToken()) { ]
        switch (jp.getCurrentToken()) {
        case VALUE_NUMBER_INT: // assume it's millisecond count
            return new Period(jp.getLongValue());           
        case VALUE_STRING:
            return new Period(jp.getText());
        }
        throw ctxt.wrongTokenException(jp, JsonToken.START_ARRAY, "expected JSON Number or String");
   }
View Full Code Here

     *
     * @param type  the period type to use, null means standard
     * @return a Period created using the millisecond duration from this instance
     */
    public Period toPeriod(PeriodType type) {
        return new Period(getMillis(), type);
    }
View Full Code Here

     *
     * @param chrono  the chronology to use, null means ISO default
     * @return a Period created using the millisecond duration from this instance
     */
    public Period toPeriod(Chronology chrono) {
        return new Period(getMillis(), chrono);
    }
View Full Code Here

     * @param type  the period type to use, null means standard
     * @param chrono  the chronology to use, null means ISO default
     * @return a Period created using the millisecond duration from this instance
     */
    public Period toPeriod(PeriodType type, Chronology chrono) {
        return new Period(getMillis(), type, chrono);
    }
View Full Code Here

     *
     * @param startInstant  the instant to calculate the period from, null means now
     * @return a Period created using the millisecond duration from this instance
     */
    public Period toPeriodFrom(ReadableInstant startInstant) {
        return new Period(startInstant, this);
    }
View Full Code Here

     * @param startInstant  the instant to calculate the period from, null means now
     * @param type  the period type determining how to split the duration into fields, null means All type
     * @return a Period created using the millisecond duration from this instance
     */
    public Period toPeriodFrom(ReadableInstant startInstant, PeriodType type) {
        return new Period(startInstant, this, type);
    }
View Full Code Here

     *
     * @param endInstant  the instant to calculate the period to, null means now
     * @return a Period created using the millisecond duration from this instance
     */
    public Period toPeriodTo(ReadableInstant endInstant) {
        return new Period(this, endInstant);
    }
View Full Code Here

     * @param endInstant  the instant to calculate the period to, null means now
     * @param type  the period type determining how to split the duration into fields, null means All type
     * @return a Period created using the millisecond duration from this instance
     */
    public Period toPeriodTo(ReadableInstant endInstant, PeriodType type) {
        return new Period(this, endInstant, type);
    }
View Full Code Here

TOP

Related Classes of com.facebook.presto.jdbc.internal.joda.time.Period

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.