Package java.util

Examples of java.util.Date.compareTo()


        Iterator iter = query_result.iterator();
        int cnt = 0;
        while( iter.hasNext() ){
            AllTypes obj = (AllTypes) iter.next();
            Date val = obj.getDate();
            boolean correct_value = valueOnLeft ? (value.compareTo(val) <= 0) : (val.compareTo(value) <= 0);
            if( !correct_value ){
                fail(ASSERTION_FAILED, "JDOQL LessThanOrEqual test returns incorrect value, retrieved value: " + val + ", with parameter value: " + value, filter, parameter);
            }
            cnt++;
        }
View Full Code Here


                Date xDate = ((Entry)xObj).getPublished();
                Date yDate = ((Entry)yObj).getPublished();
                if (xDate == null)
                    return -1;
                if (newFirst)
                    return yDate.compareTo(xDate);
                else
                    return xDate.compareTo(yDate);
            }
        });
        return Arrays.asList(entriesArray);
View Full Code Here

        Date now = new Date();
        Date lateTime = nominalTime;
        long delayMilliSeconds = evaluator.evaluate(delay.toString(), Long.class);
        int factor = 1;
        // TODO we can get rid of this using formula
        while (lateTime.compareTo(now) <= 0) {
            lateTime = addTime(lateTime, (int) (factor * delayMilliSeconds));
            factor *= getPower();
        }
        if (lateTime.after(cutOffTime)) {
            lateTime = cutOffTime;
View Full Code Here

                if ( feedUpdated != null ) {
                    predicate = request.getHeader( "If-Unmodified-Since" );
                    if ( predicate != null ) {
                        try {
                            Date predicateDate = dateFormat.parse( predicate );
                            if ( predicateDate.compareTo( exactSeconds(feedUpdated) ) < 0 ) {
                                // Match, should short circuit
                                response.sendError(HttpServletResponse.SC_PRECONDITION_FAILED);
                                return;
                            }
                        } catch ( java.text.ParseException e ) {
View Full Code Here

                    }
                    predicate = request.getHeader( "If-Modified-Since" );
                    if ( predicate != null ) {
                        try {
                            Date predicateDate = dateFormat.parse( predicate );
                            if ( predicateDate.compareTo( exactSeconds(feedUpdated) ) >= 0 ) {
                                // Match, should short circuit
                                response.sendError(HttpServletResponse.SC_NOT_MODIFIED);
                                return;
                            }
                        } catch ( java.text.ParseException e ) {
View Full Code Here

                if ( entryUpdated != null ) {
                    predicate = request.getHeader( "If-Unmodified-Since" );
                    if ( predicate != null ) {
                        try {
                            Date predicateDate = dateFormat.parse( predicate );
                            if ( predicateDate.compareTo( entryUpdated ) < 0 ) {
                                // Match, should short circuit
                                response.sendError(HttpServletResponse.SC_NOT_MODIFIED);
                                return;
                            }
                        } catch ( java.text.ParseException e ) {
View Full Code Here

                    }
                    predicate = request.getHeader( "If-Modified-Since" );
                    if ( predicate != null ) {
                        try {
                            Date predicateDate = dateFormat.parse( predicate );
                            if ( predicateDate.compareTo( entryUpdated ) > 0 ) {
                                // Match, should short circuit
                                response.sendError(HttpServletResponse.SC_NOT_MODIFIED);
                                return;
                            }
                        } catch ( java.text.ParseException e ) {
View Full Code Here

                // Add entries to the feed
                for (Entry<Object, Object> entry: collection) {
                    org.apache.abdera.model.Entry feedEntry = feedEntry(entry, itemClassType, itemXMLType, mediator, abderaFactory);
                    // Use the most recent entry update as the feed update
                    Date entryUpdated = feedEntry.getUpdated();
                    if (( entryUpdated != null ) && (entryUpdated.compareTo( responseLastModified  ) > 0 )) {
                        responseLastModified = entryUpdated;
                    }
                    feed.addEntry(feedEntry);
                }
                // If no entries were newly updated,
View Full Code Here

                Date xDate = xItem.getDate();
                Date yDate = yItem.getDate();
                if (xDate == null)
                    return -1;
                if (newFirst)
                    return yDate.compareTo(xDate);
                else
                    return xDate.compareTo(yDate);
            }
        });
        return Arrays.asList(entriesArray);
View Full Code Here

                final Date resultDate = dateValueFacet.dateValue(resultAdapter);

                final DateParser dateParser = performContext.getDateParser();
                final Date expectedDate = dateParser.parse(expected);
                if (expectedDate != null) {
                    if (expectedDate.compareTo(resultDate) == 0) {
                        return resultAdapter; // ok
                    }
                }
                final String format = dateParser.format(resultDate);
                throw ScenarioBoundValueException.current(arg0Binding, format);
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.