Package java.util

Examples of java.util.GregorianCalendar.before()


        rooms.remove(booking.getRoom());
      }
     
       // controllo per le camere libere
     
      if((beginDate.after(endDate) && beginDate.after(startDate)) || (finishDate.before(startDate) && finishDate.before(endDate)))
       
      { 
        roomsMap.put("free_"+ booking.getRoom().getId(), booking.getRoom());
       
        rooms.remove(booking.getRoom());
View Full Code Here


        rooms.remove(booking.getRoom());
      }
     
       // controllo per le camere libere
     
      if((beginDate.after(endDate) && beginDate.after(startDate)) || (finishDate.before(startDate) && finishDate.before(endDate)))
       
      { 
        roomsMap.put("free_"+ booking.getRoom().getId(), booking.getRoom());
       
        rooms.remove(booking.getRoom());
View Full Code Here

                        if ( !stringDueDate.equals( "" ) ) {
                            GregorianCalendar gregoriancalendarDueDate =
                                this.getGregorianCalendarFromString( stringDueDate );
                           
                            // Testing if the due date is before the calculated end date
                            if ( gregoriancalendarDueDate.before( gregoriancalendarEndDate ) ) {
                                /* Getting the date when the processing of the feature/bug should
                                   be started at the latest */
                                GregorianCalendar gregoriancalendarLatestDateToStart =
                                    this.getWorkday( gregoriancalendarDueDate,
                                                     -( intNeededDays - 1 ),
View Full Code Here

                        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

                    if (strings.length != 2) {
                        throw new IllegalArgumentException("Time " + time + " is not valid");
                    }
                    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.measureValues.get(this.measureValues.size()-1).getTime().clone();
    lowerBorder.roll(GregorianCalendar.HOUR,-1);

    if (this.measureValues.size() > 0) {
      for (int i = this.measureValues.size()-1; i >= 0; i--) {
        if (lowerBorder.before(this.measureValues.get(i).getTime()) ||
          lowerBorder.equals(this.measureValues.get(i).getTime())) {
         
          counter++;
          if (this.measureValues.get(i).getValue() > MeasuringPoint.BORDERVALUE) {
            bcounter++;
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 lowerBorder = (GregorianCalendar)this.measureValues.get(this.measureValues.size()-1).getTime().clone();
    lowerBorder.roll(GregorianCalendar.HOUR,-1);

    if (this.measureValues.size() > 0) {
      for (int i = this.measureValues.size()-1; i >= 0; i--) {
        if (lowerBorder.before(this.measureValues.get(i).getTime()) ||
          lowerBorder.equals(this.measureValues.get(i).getTime())) {
         
          counter++;
          if (this.measureValues.get(i).getValue() > MeasuringPoint.BORDERVALUE) {
            bcounter++;
View Full Code Here

    // Test leap year if current year is a leap year
    public void testFeb29IfLeapYear() throws Exception{
        GregorianCalendar now = new GregorianCalendar();
        final int thisYear = now.get(Calendar.YEAR);
        if (now.isLeapYear(thisYear) && now.before(new GregorianCalendar(thisYear,Calendar.AUGUST,29))){
            GregorianCalendar target = new GregorianCalendar(thisYear,Calendar.FEBRUARY,29);
            checkShortParse("Feb 29th",now,target);
        } else {
            System.out.println("Skipping Feb 29 test");
        }
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

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.