Package java.util

Examples of java.util.Calendar.after()


                Calendar min = dateConstraint.minValue().getDate(false);
                Calendar max = dateConstraint.maxValue().getDate(true);
                Calendar date = Calendar.getInstance();
                date.setTime((Date) object);
                if (date.before(min)) errors.add(new ValidationError(field.getName(), errorCodes[2], dateConstraint, object));
                if (date.after(max)) errors.add(new ValidationError(field.getName(), errorCodes[3], dateConstraint, object));
            }
        }
        return errors;
    }
View Full Code Here


    {
        Calendar aAsCalendar = (Calendar)objectA;
        Calendar bAsCalendar = (Calendar)objectB;
        int result = 0;

        if (bAsCalendar.after(aAsCalendar))
        {
            // set result to a negative integer if the first argument of this
            // method is less than the second
            result = -1;
        }
View Full Code Here

   
    Calendar ec = Calendar.getInstance();
    ec.setTime(timeRange[1]);
   
    assertTrue(sc.before(nc));
    assertTrue(ec.after(nc));
    assertTrue(sc.before(ec));   
    assertEquals(sc.get(Calendar.HOUR_OF_DAY),0);
    assertEquals(ec.get(Calendar.HOUR_OF_DAY),23);
    assertEquals(sc.get(Calendar.DAY_OF_MONTH),ec.get(Calendar.DAY_OF_MONTH));
  }
View Full Code Here

   
    Calendar ec = Calendar.getInstance();
    ec.setTime(timeRange[1]);
   
    assertTrue(sc.before(nc));
    assertTrue(ec.after(nc));
    assertTrue(sc.before(ec));
  }
 
  public void testGetTimeRangeDateLastMonth() throws Exception{
    Date[] timeRange = GnizrDaoUtil.getTimeRangeDate(TimeRange.LAST_MONTH);
View Full Code Here

   
    Calendar ec = Calendar.getInstance();
    ec.setTime(timeRange[1]);
   
    assertTrue(sc.before(nc));
    assertTrue(ec.after(nc));
    assertTrue(sc.before(ec));
  }
 
  public void testDetectMIMEType() throws Exception{
    int mimeTypeId = GnizrDaoUtil.detectMIMEType("http://www.cnn.com");
View Full Code Here

        cal.set(Calendar.HOUR_OF_DAY, hours);
        cal.set(Calendar.MINUTE, minutes);
        cal.set(Calendar.SECOND, seconds);
        // add one day if the current timestamp is after the calculated cycle
        // TODO: Was ist im Dezember?
        if (cal.after(SOSDate.getCurrentTime()))
          cal.add(Calendar.DAY_OF_MONTH, 1);
      }
      else
        if (expirationPeriod.indexOf(":") > -1) {
          String[] timeArray = expirationPeriod.split(":");
View Full Code Here

      old.add(Calendar.HOUR, 24 * 4);
      boolean isupdate = false;
      int i = 0;
      while (i < blogs.size()) {
        BlogData data = blogs.get(i);
        if (old.after(data.last)) {
          blogs.remove(i);
          isupdate = true;
        } else {
          i++;
        }
View Full Code Here

    }
        // Validate the time it took the message to travel
        // if (timestamp.getCreated().before(validCreation) ||
        // !timestamp.getCreated().equals(validCreation)) {
        Calendar cre = timestamp.getCreated();
        if (cre != null && !cre.after(validCreation)) {
            if (doDebug) {
                log.debug("Validation of Timestamp: The message was created too long ago");
            }
            return false;
        }
View Full Code Here

    protected boolean verifyTimestamp(Timestamp timestamp, int timeToLive) throws WSSecurityException {

        // Calculate the time that is allowed for the message to travel
        Calendar validCreation = Calendar.getInstance();
        Calendar cre = timestamp.getCreated();
        if (cre != null && cre.after(validCreation)) {
            if (doDebug) {
                log.debug("Validation of Timestamp: The message was created in the future!");
            }
            return false;
        }
View Full Code Here

            }
        }
        // Validate the time it took the message to travel
        // if (timestamp.getCreated().before(validCreation) ||
        // !timestamp.getCreated().equals(validCreation)) {
        if (cre != null && !cre.after(validCreation)) {
            if (doDebug) {
                log.debug("Validation of Timestamp: The message was created too long ago");
            }
            return false;
        }
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.