Package ch.agent.t2.time

Examples of ch.agent.t2.time.Day


    }

    @Override
    public DateTime scan(String value) throws T2DBException {
      try {
        return new DateTime(value);
      } catch (Exception e) {
        throw T2DBMsg.exception(e, D.D10107, value, ValueType.class.getName());
      }
    }
View Full Code Here


    }

    @Override
    public Day scan(String value) throws T2DBException {
      try {
        return new Day(value);
      } catch (Exception e) {
        throw T2DBMsg.exception(e, D.D10107, value, ValueType.class.getName());
      }
    }
View Full Code Here

   * @param expr a non-null day expression
   * @return a Day
   * @throws T2Exception
   */
  public static Day parseDay(String expr) throws T2Exception {
    return new Day(parseDay(expr, Day.DOMAIN, Adjustment.NONE));
  }
View Full Code Here

    if (month == 0) {
      month = 1;
      daysInPeriod = isLeap(year) ? 366 : 365;
    } else
      daysInPeriod = daysInMonth(year, month);
    TimeIndex t = new Day(year, month, 1);
    DayOfWeek firstOfPeriod = t.getDayOfWeek();
    int workRank = rank;
    if (workRank < 0)
      workRank = max; // try the max
    int week1Offset = name.ordinal() - firstOfPeriod.ordinal();
    if (week1Offset < 0)
View Full Code Here

    if (time.getTimeDomain().compareResolutionTo(Resolution.MONTH) > 0)
      throw T2Msg.exception(K.T1059, time.toString(), Resolution.MONTH.name());
    long y = time.getYear();
    int m = time.getMonth();
    int day = getDayByRank(y, m, dayName, rank);
    return day == 0 ? null : new Day(y, m, day);
  }
View Full Code Here

    int yearDay = getDayByRank(y, 0, dayName, rank);
    if (yearDay == 0)
      return null;
    else {
      int[] md = computeMonthAndDay(y, yearDay);
      return new Day(y, md[0], md[1]);
    }
  }
View Full Code Here

   * @param expr a non-null day expression
   * @return a Day
   * @throws T2Exception
   */
  public static Day parseDay(String expr) throws T2Exception {
    return new Day(parseDay(expr, Day.DOMAIN, Adjustment.NONE));
  }
View Full Code Here

    if (month == 0) {
      month = 1;
      daysInPeriod = isLeap(year) ? 366 : 365;
    } else
      daysInPeriod = daysInMonth(year, month);
    TimeIndex t = new Day(year, month, 1);
    DayOfWeek firstOfPeriod = t.getDayOfWeek();
    int workRank = rank;
    if (workRank < 0)
      workRank = max; // try the max
    int week1Offset = name.ordinal() - firstOfPeriod.ordinal();
    if (week1Offset < 0)
View Full Code Here

    if (time.getTimeDomain().compareResolutionTo(Resolution.MONTH) > 0)
      throw T2Msg.exception(K.T1059, time.toString(), Resolution.MONTH.name());
    long y = time.getYear();
    int m = time.getMonth();
    int day = getDayByRank(y, m, dayName, rank);
    return day == 0 ? null : new Day(y, m, day);
  }
View Full Code Here

    int yearDay = getDayByRank(y, 0, dayName, rank);
    if (yearDay == 0)
      return null;
    else {
      int[] md = computeMonthAndDay(y, yearDay);
      return new Day(y, md[0], md[1]);
    }
  }
View Full Code Here

TOP

Related Classes of ch.agent.t2.time.Day

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.