Package java.util

Examples of java.util.Date.before()


        String nonce = _nonceGenerator.next();

        Date nonceDate = _dateFormat.parse(nonce);

        assertNotNull(nonceDate);
        assertTrue(nonceDate.before(new Date()));
    }

    public static Test suite()
    {
        return new TestSuite(AbstractNonceGeneratorTest.class);
View Full Code Here


                // complete(), which will recalculate the fields.  Since we can't access
                // the fields[] array in Calendar, we clone the entire object.  This will
                // stop working if Calendar.clone() is ever rewritten to call complete().
                Calendar savedCalendar = (Calendar)calendar.clone();
                parsedDate = calendar.getTime();
                if (parsedDate.before(defaultCenturyStart))
                {
                    // We can't use add here because that does a complete() first.
                    savedCalendar.set(Calendar.YEAR, defaultCenturyStartYear + 100);
                    parsedDate = savedCalendar.getTime();
                }
View Full Code Here

  public static boolean isExpired(TemporalActiveEntity entity) {
    Date now = new Date();
    if (null == entity.getEffectiveAt()) return true;
    return entity.getEffectiveAt().after(now)
        || (null != entity.getInvalidAt() && !now.before(entity.getInvalidAt()));
  }

}
View Full Code Here

public class CalendarTest {

  public void  testRoll(){
    Calendar calendar= Calendar.getInstance();
    Date ajusted= DateUtils.rollMinutes(calendar.getTime(),-30);
    assertTrue(ajusted.before(calendar.getTime()));
  }
}
View Full Code Here

        Delay res = Delay.getDelay(Delay.NONE);
        int completionPercentage = t.getCompletionPercentage();
        if (t.isMilestone() || completionPercentage == 100)
            return res;
        Date endDate = t.getEnd().getTime();
        if (endDate.before(myToday))
            if (t.isCritical())
                res.setType(Delay.CRITICAL);
            else
                res.setType(Delay.NORMAL);
        return res;
View Full Code Here

      int length = 0;
      while(true) {
        ChartModelBase.Offset[] offsets = getChartModel().calculateOffsets(myCurrentTimeFrame, myCurrentUnit, offsetDate, getChartModel().getTimeUnitStack().getDefaultTimeUnit(), getChartModel().getBottomUnitWidth());
        assert offsets.length>0;
        Date lastOffsetEnd = offsets[offsets.length-1].getOffsetEnd();
        if (lastOffsetEnd.before(anchorDate)) {
          offsetDate = lastOffsetEnd;
          length += offsets[offsets.length-1].getOffsetPixels();
          continue;
        }
      for (int i=offsets.length-1; i>=0; i--) {
View Full Code Here

            if (offsets.length==0) {
                throw new IllegalStateException("Failed to calculate offsets for anchorDate="+anchorDate);
            }
            Date lastOffsetEnd = offsets[offsets.length-1].getOffsetEnd();
            //System.err.println("[TaskRendererImpl] getPositiveOffset(): |offsets|="+offsets.length+" last offset end="+lastOffsetEnd+" last offset pixels="+offsets[offsets.length-1].getOffsetPixels());
            if (lastOffsetEnd.before(offsetDate)) {
                anchorDate = lastOffsetEnd;
                length += offsets[offsets.length-1].getOffsetPixels();
                continue;
            }
            //int firstOffsetPixels = offsets[0].getOffsetPixels();
View Full Code Here

    private Date calculateEndDate() {
        // int countFrameable =
        // myTopUnit.getAtomCount((TimeUnit)myHighestFrameable);
        Date date = myTopUnit.adjustRight(myBaseDate);
        if (date.before(myStartDate)) {
            throw new IllegalStateException("End date="+date+" start="+myStartDate+" base="+myBaseDate);
        }
        // for (int i=0; i<countFrameable; i++) {
        // date = myHighestFrameable.adjustRight(date);
        // }
View Full Code Here

        List result = new ArrayList();
        Date curDayStart = myFramer.adjustLeft(startDate);
        boolean isWeekendState = isNonWorkingDay(curDayStart);
        // System.err.println("getActivities(): start="+startDate+"
        // end="+endDate);
        while (curDayStart.before(endDate)) {
            // System.err.println("curDayStart="+curDayStart);
            Date changeStateDayStart = getStateChangeDate(curDayStart,
                    !isWeekendState);
            // System.err.println("changeStateDayStart="+changeStateDayStart);
            if (changeStateDayStart.before(endDate)) {
View Full Code Here

        while (curDayStart.before(endDate)) {
            // System.err.println("curDayStart="+curDayStart);
            Date changeStateDayStart = getStateChangeDate(curDayStart,
                    !isWeekendState);
            // System.err.println("changeStateDayStart="+changeStateDayStart);
            if (changeStateDayStart.before(endDate)) {
                result.add(new CalendarActivityImpl(curDayStart,
                        changeStateDayStart, !isWeekendState));
                curDayStart = changeStateDayStart;
                isWeekendState = !isWeekendState;
                continue;
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.