Package java.util

Examples of java.util.Calendar.after()


    protected int advanceCalendar(Calendar start, Calendar end, int units, int type) {
        if (units >= 1) {
            Calendar tmp = (Calendar) start.clone();
            tmp.add(type, units);
            while (tmp.after(end)) {
                tmp.add(type, -1);
                units--;
            }
            if (units != 0) {
                start.add(type, units);
View Full Code Here


                return skip;
            }
            float units = deltaMillis / divisor;
            units = (units / this.freqCount) * this.freqCount;
            skip.add(this.freqType, (int)units);
            while (skip.after(cal)) {
                skip.add(this.freqType, -this.freqCount);
            }
            return skip;
        }

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

    try {
      Calendar now= Calendar.getInstance();
      Date nowDate= m_inFormat.parse(m_inFormat.format(now.getTime()));
      now.setTime(nowDate);
     
      return !now.after(m_expireDate);
    }
    catch(ParseException pex) {
      throw new TestNGException("Cannot compare dates.");
    }
  }
View Full Code Here

          throw new FTPListParseException();
        }
        if (checkYear) {
          Calendar mc = Calendar.getInstance();
          mc.setTime(md);
          if (mc.after(now)) {
            mc.set(Calendar.YEAR, currentYear - 1);
            md = mc.getTime();
          }
        }
        ret[i].setModifiedDate(md);
View Full Code Here

          throw new FTPListParseException();
        }
        if (checkYear) {
          Calendar mc = Calendar.getInstance();
          mc.setTime(md);
          if (mc.after(now)) {
            mc.set(Calendar.YEAR, currentYear - 1);
            md = mc.getTime();
          }
        }
        ret[i].setModifiedDate(md);
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

        nextTriggerDate.set(Calendar.SECOND, 0);

        Calendar now = Calendar.getInstance(timeZone);
        now.setTimeInMillis(currentTime);

        if(now.after(nextTriggerDate)){
            nextTriggerDate.add(Calendar.MONTH, 1);
        }

        long nextToTriggerTime = nextTriggerDate.getTimeInMillis();
        return nextToTriggerTime - currentTime;
View Full Code Here

    public void addThumbnail(AddedNodeFact imageNode, String name, int size,boolean square, KnowledgeHelper drools) throws Exception {
        if (imageNode.getNode().hasNode(name)) {
            JCRNodeWrapper node = imageNode.getNode().getNode(name);
            Calendar thumbDate = node.getProperty("jcr:lastModified").getDate();
            Calendar contentDate = imageNode.getNode().getNode("jcr:content").getProperty("jcr:lastModified").getDate();
            if (contentDate.after(thumbDate)) {
                AddedNodeFact thumbNode = new AddedNodeFact(node);
                File f = getThumbFile(imageNode, size,square, drools);
                drools.insert(new ChangedPropertyFact(thumbNode, Constants.JCR_DATA, f, drools));
                drools.insert(new ChangedPropertyFact(thumbNode, Constants.JCR_LASTMODIFIED, new GregorianCalendar(), drools));
            }
View Full Code Here

            enddate=(ganttDao.getDueDate()).toString();
            //System.out.println(enddate);
           
            if(dueDateCalendar.before(firstDate)){
              dueDate = 0;
            }else if(dueDateCalendar.after(lastDate)){
              dueDate = lastDateOfMonth;//implicitly make it out of bound
            }else{
              dueDate = ganttDao.getDueDate().getDate();
            }
          }else{
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.