Package java.util

Examples of java.util.Date.compareTo()


        if (db instanceof Timestamp) {
          db = new Date(db.getTime());
        }
       
       
        return (asc ? da.compareTo(db) : db.compareTo(da));
      }

    }

    private MessageComparator msgcomp;
View Full Code Here


    List<KalendarEvent> nextEvents = new ArrayList<KalendarEvent>();
    for (KalendarRenderWrapper calendar : myCal.getCalendars()) {
      Kalendar cal = calendar.getKalendar();
      Collection<KalendarEvent> events = cal.getEvents();
      for (KalendarEvent event : events) {
        if (refDate.compareTo(event.getBegin()) <= 0) {
          nextEvents.add(event);
        }
      }
    }
    Collections.sort(nextEvents, new KalendarEventComparator());
View Full Code Here

    begin = System.currentTimeMillis();
    final Date d = new Date(begin);
    for (int i = 0; i < MAX; ++i) {
      final long timerLong = Long.parseLong(timer);
      int result = d.compareTo(new Date(timerLong));
    }
    System.out.println("Date: " + (System.currentTimeMillis() - begin));
    // ------------------------------------------------------------------------

    begin = System.currentTimeMillis();
View Full Code Here

    begin = System.currentTimeMillis();
    final String today = "20110526165400";
    final SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");
    for (int i = 0; i < MAX; ++i) {
      int result = d.compareTo(df.parse(today));
    }
    System.out.println("String: " + (System.currentTimeMillis() - begin));
    // ------------------------------------------------------------------------

    Calendar c = Calendar.getInstance();
View Full Code Here

          syslogYear = cal.get(Calendar.YEAR);
      }
      cal.setTime(syslogDate);
      cal.set(Calendar.YEAR, syslogYear);
      syslogDate = cal.getTime();
      assertTrue(syslogDate.compareTo(preDate) >= 0);
      assertTrue(syslogDate.compareTo(postDate) <= 0);
    }


    /**
 
View Full Code Here

      }
      cal.setTime(syslogDate);
      cal.set(Calendar.YEAR, syslogYear);
      syslogDate = cal.getTime();
      assertTrue(syslogDate.compareTo(preDate) >= 0);
      assertTrue(syslogDate.compareTo(postDate) <= 0);
    }


    /**
     * Tests that any header or footer in layout is sent.
View Full Code Here

        private boolean matches(Date last, Date now, Calendar time,
            int[][] times, int depth) {
            if (depth == UNITS.length) {
                Date compare = time.getTime();
                return compare.compareTo(last) >= 0 &&
                    compare.compareTo(now) < 0;
            }

            if (times[depth] != WILDCARD) {
                for (int i = 0; i < times[depth].length; i++) {
View Full Code Here

        private boolean matches(Date last, Date now, Calendar time,
            int[][] times, int depth) {
            if (depth == UNITS.length) {
                Date compare = time.getTime();
                return compare.compareTo(last) >= 0 &&
                    compare.compareTo(now) < 0;
            }

            if (times[depth] != WILDCARD) {
                for (int i = 0; i < times[depth].length; i++) {
                    time.set(UNITS[depth], times[depth][i]);
View Full Code Here

        Date from = e.getStart();
        Date toTime = e.getEndTime();
        for (int i = 1; i < dateCount; i++) {
            DateCell dc = (DateCell) content.getWidget(i);
            Date dcDate = dc.getDate();
            int comp = dcDate.compareTo(from);
            int comp2 = dcDate.compareTo(toTime);
            if (comp >= 0
                    && comp2 < 0
                    || (comp == 0 && comp2 == 0 && VCalendar
                            .isZeroLengthMidnightEvent(e))) {
View Full Code Here

        Date toTime = e.getEndTime();
        for (int i = 1; i < dateCount; i++) {
            DateCell dc = (DateCell) content.getWidget(i);
            Date dcDate = dc.getDate();
            int comp = dcDate.compareTo(from);
            int comp2 = dcDate.compareTo(toTime);
            if (comp >= 0
                    && comp2 < 0
                    || (comp == 0 && comp2 == 0 && VCalendar
                            .isZeroLengthMidnightEvent(e))) {
                // Same event may be over two DateCells if event's date
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.