Package java.util

Examples of java.util.GregorianCalendar.clone()


      Map<String,Integer> failureModes = new HashMap<String,Integer>();
      for(Entry<GregorianCalendar,DumpElement> entry : map.entrySet()) {
        GregorianCalendar date = entry.getKey();
        DumpElement element = entry.getValue();
        if(element.pullTimes != null) {
          date = (GregorianCalendar) date.clone();
          date.add(Calendar.DAY_OF_MONTH, -delta);
          System.out.println("Checking "+date.getTime()+" for "+element.date.getTime()+" delta "+delta);
          DumpElement inserted = map.get(date);
          if(inserted == null) {
            System.out.println("No match");
View Full Code Here


      target.set(Calendar.MINUTE, 0);
      target.set(Calendar.MILLISECOND, 0);
      target.set(Calendar.SECOND, 0);
      GregorianCalendar[] targets = new GregorianCalendar[MAX_N+1];
      for(int i=0;i<targets.length;i++) {
        targets[i] = ((GregorianCalendar)target.clone());
        targets[i].add(Calendar.DAY_OF_MONTH, -((1<<i)-1));
        targets[i].getTime();
      }
      int[] totalFetchesByDelta = new int[MAX_N+1];
      int[] totalSuccessfulFetchesByDelta = new int[MAX_N+1];
View Full Code Here

        }
        if(INTERVAL_MULTIPLIER > 1) {
          int x = gc.get(INTERVAL);
          gc.set(INTERVAL, (x / INTERVAL_MULTIPLIER) * INTERVAL_MULTIPLIER);
        }
        findOldLogFiles((GregorianCalendar)gc.clone());
        currentFilename = new File(getHourLogName(gc, -1, true));
        synchronized(logFiles) {
          if((!logFiles.isEmpty()) && logFiles.getLast().filename.equals(currentFilename)) {
            logFiles.removeLast();
          }
View Full Code Here

    past.set( Calendar.DAY_OF_MONTH, 28 );
    past.set( Calendar.MONTH, 12 );
    past.set( Calendar.YEAR, 1976 );
    past.setTimeZone( TimeZone.getTimeZone( "Africa/Casablanca" ) );

    Calendar pastGMT = (GregorianCalendar) past.clone();
    pastGMT.setTimeZone( TimeZone.getDefault() );

    Object[][] data = new Object[][]{
        { null, null, true },
        { GregorianCalendar.getInstance(), null, false },
View Full Code Here

        {
            //This block will update day of month if it is out of bounds
            //For instance if you ask to schedule on 30th of everymonth
            //this section will set the day to 28th (or 29th) in febuary
            //as there is no 30th
            final Calendar targetMonth = (GregorianCalendar)next.clone();
            targetMonth.set( Calendar.DAY_OF_MONTH, 1 );
            targetMonth.set( Calendar.MONTH, m_month );

            final int maxDayCount = targetMonth.getActualMaximum( Calendar.DAY_OF_MONTH );
            if( maxDayCount < realDayOfMonth )
View Full Code Here

                        this.setDayOfWeek( gregoriancalendarEndDate, xcellrange,
                                           intRow, this.INT_COLUMN_END_DAY_OF_WEEK );
                       
                        // Set the initial date for the next loop
                        gregoriancalendarStartDate = ( GregorianCalendar )
                            gregoriancalendarEndDate.clone();
                       
                        // Get the due date from the table
                        String stringDueDate = this.getStringFromCell(
                            xcellrange, intRow, this.INT_COLUMN_DUEDATE );
                       
View Full Code Here

                        this.setDayOfWeek(gregCalEndDate, xcellrange,
                                          intRow, this.INT_COLUMN_END_DAY_OF_WEEK);
                       
                        // Set the initial date for the next loop
                        gregCalStartDate = ( GregorianCalendar )
                            gregCalEndDate.clone();
                       
                        // Get the due date from the table
                        String sDueDate = this.getStringFromCell(
                            xcellrange, intRow, this.INT_COLUMN_DUEDATE );
                       
View Full Code Here

                        this.setDayOfWeek(gregCalEndDate, xcellrange,
                                          intRow, this.INT_COLUMN_END_DAY_OF_WEEK);
                       
                        // Set the initial date for the next loop
                        gregCalStartDate = ( GregorianCalendar )
                            gregCalEndDate.clone();
                       
                        // Get the due date from the table
                        String sDueDate = this.getStringFromCell(
                            xcellrange, intRow, this.INT_COLUMN_DUEDATE );
                       
View Full Code Here

        cal.set(2001, 0, 1, 0, 0, 0);
        cal.set(Calendar.MILLISECOND, 0);
        while (cal.get(Calendar.DAY_OF_WEEK) != Calendar.MONDAY) {
            cal.add(Calendar.DATE, 1);
        }
        this.monday = (Calendar) cal.clone();

        // calculate 9am on the first Monday after 2001-01-01
        cal.add(Calendar.HOUR, 9);
        this.monday9am = (Calendar) cal.clone();
    }
View Full Code Here

        }
        this.monday = (Calendar) cal.clone();

        // calculate 9am on the first Monday after 2001-01-01
        cal.add(Calendar.HOUR, 9);
        this.monday9am = (Calendar) cal.clone();
    }

    /**
     * Tears down the fixture, for example, close a network connection.
     * This method is called after a test is executed.
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.