Package java.util

Examples of java.util.Calendar.roll()


                cal.set(Calendar.MINUTE, 0);
                cal.set(Calendar.SECOND, 0);
                cal.set(Calendar.MILLISECOND, 0);
                startDate = cal.getTime().getTime();

                cal.roll(Calendar.DAY_OF_YEAR, true);
                cal.add(Calendar.MILLISECOND, -1);
                endDate = cal.getTime().getTime();
            } else if (m_aggregationDuration == HOURLY_TIME) {
                cal.roll(Calendar.HOUR_OF_DAY, false);
                cal.set(Calendar.MINUTE, 0);
View Full Code Here


                cal.roll(Calendar.DAY_OF_YEAR, true);
                cal.add(Calendar.MILLISECOND, -1);
                endDate = cal.getTime().getTime();
            } else if (m_aggregationDuration == HOURLY_TIME) {
                cal.roll(Calendar.HOUR_OF_DAY, false);
                cal.set(Calendar.MINUTE, 0);
                cal.set(Calendar.SECOND, 0);
                cal.set(Calendar.MILLISECOND, 0);
                startDate = cal.getTime().getTime();
View Full Code Here

                cal.set(Calendar.MINUTE, 0);
                cal.set(Calendar.SECOND, 0);
                cal.set(Calendar.MILLISECOND, 0);
                startDate = cal.getTime().getTime();

                cal.roll(Calendar.HOUR_OF_DAY, true);
                cal.add(Calendar.MILLISECOND, -1);
                endDate = cal.getTime().getTime();
            } else {
                endDate = cal.getTime().getTime(); // current time
                cal.add(Calendar.MINUTE, -1*m_aggregationDuration);
 
View Full Code Here

        Calendar calendar = Calendar.getInstance();
        boolean isResize = params.containsKey(clientId + "_resized");
       
        if(!isResize) {
          calendar.setTime(changedEvent.getStartDate());
          calendar.roll(Calendar.DATE, dayDelta);
          changedEvent.getStartDate().setTime(calendar.getTimeInMillis());
        }
       
        calendar = Calendar.getInstance();
        calendar.setTime(changedEvent.getEndDate());
View Full Code Here

          changedEvent.getStartDate().setTime(calendar.getTimeInMillis());
        }
       
        calendar = Calendar.getInstance();
        calendar.setTime(changedEvent.getEndDate());
        calendar.roll(Calendar.DATE, dayDelta);
        changedEvent.getEndDate().setTime(calendar.getTimeInMillis());
       
        if(isResize)
          schedule.queueEvent(new ScheduleEntryResizeEvent(schedule, changedEvent, dayDelta, minuteDelta));
        else
View Full Code Here

                calendar.roll(Calendar.DATE, dayDelta);
                movedEvent.getStartDate().setTime(calendar.getTimeInMillis());

                calendar = Calendar.getInstance();
                calendar.setTime(movedEvent.getEndDate());
        calendar.roll(Calendar.DATE, dayDelta);
        movedEvent.getEndDate().setTime(calendar.getTimeInMillis());

                wrapperEvent = new ScheduleEntryMoveEvent(this, behaviorEvent.getBehavior(), movedEvent, dayDelta, minuteDelta);
            }
            else if(eventName.equals("eventResize")) {
View Full Code Here

                int dayDelta = Integer.valueOf(params.get(clientId + "_dayDelta"));
        int minuteDelta = Integer.valueOf(params.get(clientId + "_minuteDelta"));

                Calendar calendar = Calendar.getInstance();
                calendar.setTime(resizedEvent.getEndDate());
        calendar.roll(Calendar.DATE, dayDelta);
        resizedEvent.getEndDate().setTime(calendar.getTimeInMillis());

                wrapperEvent = new ScheduleEntryResizeEvent(this, behaviorEvent.getBehavior(), resizedEvent, dayDelta, minuteDelta);
            }
View Full Code Here

                int dayDelta = Integer.valueOf(params.get(clientId + "_dayDelta"));
        int minuteDelta = Integer.valueOf(params.get(clientId + "_minuteDelta"));

                Calendar calendar = Calendar.getInstance();
                calendar.setTime(movedEvent.getStartDate());
                calendar.roll(Calendar.DATE, dayDelta);
                movedEvent.getStartDate().setTime(calendar.getTimeInMillis());

                calendar = Calendar.getInstance();
                calendar.setTime(movedEvent.getEndDate());
        calendar.roll(Calendar.DATE, dayDelta);
View Full Code Here

  }

  public void cleanupJournalEntries()
  {
    Calendar date = Calendar.getInstance();
    date.roll(Calendar.DAY_OF_MONTH, true);
    date.set(Calendar.HOUR_OF_DAY, 1);
    date.set(Calendar.MINUTE, 0);
    date.set(Calendar.SECOND, 0);
    date.set(Calendar.MILLISECOND, 0);
    System.out.println("Journal cache refresh at: " + date.getTime());
View Full Code Here

        calendar.set(Calendar.YEAR, year);
        for (int i = 0; i < 11; i++) {
            Cell cell = headerRow.createCell(titles.length + i);
            cell.setCellValue(calendar);
            cell.setCellStyle(styles.get("header_date"));
            calendar.roll(Calendar.WEEK_OF_YEAR, true);
        }
        //freeze the first row
        sheet.createFreezePane(0, 1);

        Row row;
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.