Package java.util

Examples of java.util.Calendar.roll()


                    pos++; // go to next position
                }
                if(pos >= dayAdd.length) {
                    pos = 0; // go to zero position
                }
                calcDateWeek.roll(Calendar.DAY_OF_WEEK, 1);
            }
           
            if(log.isDebugEnabled())
            {
                StringBuilder builder = new StringBuilder();
View Full Code Here


        reply.setRetryAfter(a - n);
    else {
        cal.setTime(new Date(getLong(ATTR_DATE_START, -1)));
        cal.set(Calendar.YEAR, n_year);
        cal.set(Calendar.MONTH, n_month);
        cal.roll(Calendar.MONTH, true);
        reply.setRetryAfter(cal.getTime().getTime());
    }
      }
  } else if (getYearRepeat()) { // check it if it's repeated every year
      Calendar c_a = Calendar.getInstance();
View Full Code Here

        final Calendar cal = Calendar.getInstance();
        final PlayerHistory playerHistory1 = createPlayerHistory(player);
        playerHistory1.setPlayer(player);
        playerHistory1.setImportDate(cal.getTime());

        cal.roll(Calendar.MONTH, -1);
        final PlayerHistory playerHistory2 = createPlayerHistory(player);
        playerHistory2.setPlayer(player);
        playerHistory2.setImportDate(cal.getTime());

        em.getTransaction().begin();
View Full Code Here

        cal.set(Calendar.HOUR_OF_DAY, 2);
        long tod = cal.getTimeInMillis();
        LogEvent event = new Log4jLogEvent(null, null, null, null, null, null, null, null, null, null, tod);
        assertTrue(filter.filter(null, Level.ERROR, null, null, (Throwable)null) == Filter.Result.NEUTRAL);
        assertTrue(filter.filter(event) == Filter.Result.NEUTRAL);
        cal.roll(Calendar.DAY_OF_MONTH, true);
        tod = cal.getTimeInMillis();
        event = new Log4jLogEvent(null, null, null, null, null, null, null, null, null, null, tod);
        assertTrue(filter.filter(event) == Filter.Result.NEUTRAL);
        cal.set(Calendar.HOUR_OF_DAY, 4);
        tod = cal.getTimeInMillis();
View Full Code Here

    private void update(int addend, boolean shifted) {
        Calendar c = parseDate(getText());
        int pos = getCaretPosition();
        int field = posToField(pos);
        if (shifted) {
            c.roll(field, true);
        } else {
            c.add(field, addend);
        }
        String newDate = dateFormat.format(c.getTime());
        setText(newDate);
View Full Code Here

  /**
   */
  public String browse() throws Exception {
    Calendar cal = GregorianCalendar.getInstance();
    now = cal.getTime();
    cal.roll(Calendar.DATE, -1);
    cal.roll(Calendar.HOUR, -3);
    past = cal.getTime();
    cal.roll(Calendar.DATE, 2);
    future = cal.getTime();

View Full Code Here

   */
  public String browse() throws Exception {
    Calendar cal = GregorianCalendar.getInstance();
    now = cal.getTime();
    cal.roll(Calendar.DATE, -1);
    cal.roll(Calendar.HOUR, -3);
    past = cal.getTime();
    cal.roll(Calendar.DATE, 2);
    future = cal.getTime();

    cal.roll(Calendar.YEAR, -1);
View Full Code Here

    Calendar cal = GregorianCalendar.getInstance();
    now = cal.getTime();
    cal.roll(Calendar.DATE, -1);
    cal.roll(Calendar.HOUR, -3);
    past = cal.getTime();
    cal.roll(Calendar.DATE, 2);
    future = cal.getTime();

    cal.roll(Calendar.YEAR, -1);
    before = cal.getTime();
View Full Code Here

    cal.roll(Calendar.HOUR, -3);
    past = cal.getTime();
    cal.roll(Calendar.DATE, 2);
    future = cal.getTime();

    cal.roll(Calendar.YEAR, -1);
    before = cal.getTime();

    cal.roll(Calendar.YEAR, 2);
    after = cal.getTime();
    return SUCCESS;
View Full Code Here

    future = cal.getTime();

    cal.roll(Calendar.YEAR, -1);
    before = cal.getTime();

    cal.roll(Calendar.YEAR, 2);
    after = cal.getTime();
    return SUCCESS;
  }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.