Package com.google.code.or.common.glossary.column

Examples of com.google.code.or.common.glossary.column.TimeColumn


      String str = new String(sc.getValue(), Charset.defaultCharset());
      return str;
    }
    else if (s instanceof TimeColumn)
    {
      TimeColumn tc = (TimeColumn) s;
      Time t = tc.getValue();
      /**
       * There is a bug in OR where instead of using the default year as 1970, it is using 0070.
       * This is a temporary measure to resolve it by working around at this layer. The value obtained from OR is subtracted from "0070-00-01 00:00:00"
       */
      Calendar c = Calendar.getInstance();
      c.set(70, 0, 1, 0, 0, 0);
      // round off the milli-seconds as TimeColumn type has only seconds granularity but Calendar implementation
      // includes milli-second (System.currentTimeMillis() at the time of instantiation)
      long rawVal = (c.getTimeInMillis()/1000) * 1000;
      long val2 = (t.getTime()/1000) * 1000;
      long offset = val2 - rawVal;
      return offset;
    }
    else if (s instanceof TimestampColumn)
    {
      TimestampColumn tsc = (TimestampColumn) s;
      Timestamp ts = tsc.getValue();
      Long t = ts.getTime();
      return t;
    }
    else if (s instanceof TinyColumn)
    {
      TinyColumn tc = (TinyColumn) s;
      Integer i = tc.getValue();
      return i;
    }
    else if (s instanceof YearColumn)
    {
      YearColumn yc = (YearColumn) s;
View Full Code Here

TOP

Related Classes of com.google.code.or.common.glossary.column.TimeColumn

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.