Package com.impossibl.postgres.types.PrimitiveType

Examples of com.impossibl.postgres.types.PrimitiveType.Interval


      long timeMicros = buffer.readLong();
      int days = buffer.readInt();
      int months = buffer.readInt();

      return new Interval(months, days, timeMicros);
    }
View Full Code Here


        buffer.writeInt(-1);
      }
      else {

        Interval interval = (Interval) val;

        buffer.writeInt(16);
        buffer.writeLong(interval.getRawTime());
        buffer.writeInt(interval.getRawDays());
        buffer.writeInt(interval.getRawMonths());
      }

    }
View Full Code Here

    }

    @Override
    public Interval decode(Type type, Short typeLength, Integer typeModifier, CharSequence buffer, Context context) throws IOException {

      return new Interval(buffer.toString());
    }
View Full Code Here

    }

    @Override
    public void encode(Type type, StringBuilder buffer, Object val, Context context) throws IOException {

      Interval ival = (Interval) val;

      buffer.
        append("@ ").
        append(ival.getYears()).append(" years ").
        append(ival.getMonths()).append(" months ").
        append(ival.getDays()).append(" days ").
        append(ival.getHours()).append(" hours ").
        append(ival.getMinutes()).append(" minutes ").
        append(format("%f", ival.getSeconds())).append(" seconds");

    }
View Full Code Here

TOP

Related Classes of com.impossibl.postgres.types.PrimitiveType.Interval

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.