Package java.util

Examples of java.util.GregorianCalendar.before()


                        System.err.println("Invalid time argument.");
                        return null;
                    }
                    GregorianCalendar currentDate = new GregorianCalendar();
                    GregorianCalendar shutdownDate = new GregorianCalendar(currentDate.get(Calendar.YEAR), currentDate.get(Calendar.MONTH), currentDate.get(Calendar.DATE), Integer.parseInt(strings[0]), Integer.parseInt(strings[1]));
                    if (shutdownDate.before(currentDate)) {
                        shutdownDate.set(Calendar.DATE, shutdownDate.get(Calendar.DATE) + 1);
                    }
                    sleep = shutdownDate.getTimeInMillis() - currentDate.getTimeInMillis();
                }
            }
View Full Code Here


      GregorianCalendar lowerBorder = (GregorianCalendar)this.measurings.get(this.measurings.size()-1).getTime().clone();
      lowerBorder.roll(GregorianCalendar.HOUR,-1);
 
      if (this.measurings.size() > 0) {
        for (int i = this.measurings.size()-1; i >= 0; i--) {
          if ((lowerBorder.before(this.measurings.get(i).getTime()) ||
            lowerBorder.equals(this.measurings.get(i).getTime()))&&
            (this.measurings.get(i).getPoint().getId()==measuring.getPoint().getId())) {
           
            counter++;
           
View Full Code Here

                            GregorianCalendar gregCalDueDate =
                                this.getGregorianCalendarFromString(sDueDate);
                           
                            // Testing if the due date is before the calculated
                            // end date
                            if ( gregCalDueDate.before(
                                     gregCalEndDate ) ) {
                                /* Getting the date when the processing of the
                                   feature/bug should
                                   be started at the latest */
                                GregorianCalendar gregCalLatestDateToStart =
View Full Code Here

        if (getMaxSessions() > 0 && numSessions >= getMaxSessions()) {
          message.setSessionStartAllowed(false);
          message.setMessageTitle("General.title");
          message.setMessageText(messages.getString("ModuleScheduler.DailyModuleScheduler.errorMessage.maxSessions"));
          return message;
        } else if (!lastSessionDate.before(todayDate)) {
          message.setSessionStartAllowed(false);
          Calendar currentDate = new GregorianCalendar();
          int hours = (23 - currentDate.get(Calendar.HOUR_OF_DAY));
          int minutes = (60 - currentDate.get(Calendar.MINUTE));
          String errorString = messages.getString("ModuleScheduler.DailyModuleScheduler.errorMessage.sameDay");
View Full Code Here

      }
      GregorianCalendar gcal = new GregorianCalendar(sessionDataObject.expire.year,
          sessionDataObject.expire.month, sessionDataObject.expire.day,
          sessionDataObject.expire.hours, sessionDataObject.expire.mins,
          sessionDataObject.expire.secs);
      if (gcal.before(new GregorianCalendar()))
      {
        throw new XMLDispatcherUserException("Session expired", "XDE_SES_EXPIRED");
      }
      return sessionDataObject.session;
    }
View Full Code Here

    }
    if (type == Calendar.YEAR) {
      gc1.clear(Calendar.MONTH);
      gc2.clear(Calendar.MONTH);
    }
    while (gc1.before(gc2)) {
      gc1.add(type, 1);
      elapsed++;
    }
    return elapsed;
  }
View Full Code Here

  private void isEndGreatBegin(IBooking command, Errors errors) {
    if(command.getBeginDate() != null && command.getFinishDate() != null){
      GregorianCalendar beginDate = command.getBeginDate();
      GregorianCalendar endDate = command.getFinishDate();
      if(beginDate != null && endDate != null && endDate.before(beginDate)){
        errors.reject("errors.endGreatBegin", "errors.EndGreatBegin");     
      }
    }
   
  } 
View Full Code Here

      }
     
     
    // controllo se e quali camere sono parzialmente occupate
     
      if((beginDate.equals(endDate) &&  beginDate.after(startDate)) || (finishDate.equals(startDate) && finishDate.before(endDate)))
     
      {
        roomsMap.put("partial_"+booking.getRoom().getId(), booking.getRoom());
          
        rooms.remove(booking.getRoom())
View Full Code Here

          
        rooms.remove(booking.getRoom())
      }
     
     
      if((beginDate.after(startDate) && CalendarUtils.isDayIntoDateRange(beginDate, finishDate, endDate)) || (CalendarUtils.isDayIntoDateRange(beginDate, finishDate, startDate) && finishDate.before(endDate)))
       
      {       
        roomsMap.put("partial_"+booking.getRoom().getId(), booking.getRoom());
          
        rooms.remove(booking.getRoom());     
View Full Code Here

          
        rooms.remove(booking.getRoom());     
      }
     
     
      if(beginDate.after(startDate) && finishDate.before(endDate))
       
      {
        roomsMap.put("partial_"+booking.getRoom().getId(), booking.getRoom());
          
        rooms.remove(booking.getRoom());
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.