public int compareTo(Object o) { if (!(o instanceof EventPeriod)) { return -1; } EventPeriod that = (EventPeriod)o; /* Sort by type first */ if (type < that.type) { return -1; } if (type > that.type) { return 1; } int res = start.compareTo(that.start); if (res != 0) { return res; } return end.compareTo(that.end); }
/** * Compares the specified period with this period. * First, compare the start dates. If they are the same, compare the end dates. * * @param arg0 a period to compare with this one * @return a postive value if this period is greater, negative if the other is * greater, or zero if they are equal */ public final int compareTo(final Period arg0) { // Throws documented exception if type is wrong or parameter is null if (arg0 == null) { throw new ClassCastException("Cannot compare this object to null"); } final int startCompare = getStart().compareTo(arg0.getStart()); if (startCompare != 0) { return startCompare; } // start dates are equal, compare end dates.. else if (duration == null) { final int endCompare = getEnd().compareTo(arg0.getEnd()); if (endCompare != 0) { return endCompare; } } // ..or durations return getDuration().compareTo(arg0.getDuration()); }
/** * Compares the specified period with this period. * * @param arg0 a period to compare with this one * @return a postive value if this period is greater, negative if the other is * greater, or zero if they are equal */ public final int compareTo(final Period arg0) { // Throws documented exception if type is wrong or parameter is null if (arg0 == null) { throw new ClassCastException("Cannot compare this object to null"); } final int startCompare = getStart().compareTo(arg0.getStart()); if (startCompare != 0) { return startCompare; } // start dates are equal, compare end dates.. else if (duration == null) { final int endCompare = getEnd().compareTo(arg0.getEnd()); if (endCompare != 0) { return endCompare; } } // ..or durations return getDuration().compareTo(arg0.getDuration()); }
/** * Compares the specified period with this period. * First, compare the start dates. If they are the same, compare the end dates. * * @param arg0 a period to compare with this one * @return a postive value if this period is greater, negative if the other is * greater, or zero if they are equal */ public final int compareTo(final Period arg0) { // Throws documented exception if type is wrong or parameter is null if (arg0 == null) { throw new ClassCastException("Cannot compare this object to null"); } final int startCompare = getStart().compareTo(arg0.getStart()); if (startCompare != 0) { return startCompare; } // start dates are equal, compare end dates.. else if (duration == null) { final int endCompare = getEnd().compareTo(arg0.getEnd()); if (endCompare != 0) { return endCompare; } } // ..or durations return getDuration().compareTo(arg0.getDuration()); }
return period.getStart().compareTo(dueDate) < 0 && period.getEnd().compareTo(dueDate) >=0; } else if(vtodo.getCreated()!=null && vtodo.getDateCompleted()!=null) { return (period.getStart().compareTo(createDate)<=0 || period.getStart().compareTo(completeDate)<=0) && (period.getEnd().compareTo(createDate)>=0 || period.getEnd().compareTo(completeDate)>=0); } else if(vtodo.getDateCompleted()!=null) { return period.getStart().compareTo(completeDate)<=0 && period.getEnd().compareTo(completeDate)>=0; } else if(vtodo.getCreated()!=null) { return period.getEnd().compareTo(createDate) > 0; } else { return true;
return period.getStart().compareTo(dueDate) < 0 && period.getEnd().compareTo(dueDate) >=0; } else if(vtodo.getCreated()!=null && vtodo.getDateCompleted()!=null) { return (period.getStart().compareTo(createDate)<=0 || period.getStart().compareTo(completeDate)<=0) && (period.getEnd().compareTo(createDate)>=0 || period.getEnd().compareTo(completeDate)>=0); } else if(vtodo.getDateCompleted()!=null) { return period.getStart().compareTo(completeDate)<=0 && period.getEnd().compareTo(completeDate)>=0; } else if(vtodo.getCreated()!=null) { return period.getEnd().compareTo(createDate) > 0; } else { return true;
/** * Compares the specified period with this period. * First, compare the start dates. If they are the same, compare the end dates. * * @param arg0 a period to compare with this one * @return a postive value if this period is greater, negative if the other is * greater, or zero if they are equal */ public final int compareTo(final Period arg0) { // Throws documented exception if type is wrong or parameter is null if (arg0 == null) { throw new ClassCastException("Cannot compare this object to null"); } final int startCompare = getStart().compareTo(arg0.getStart()); if (startCompare != 0) { return startCompare; } // start dates are equal, compare end dates.. else if (duration == null) { final int endCompare = getEnd().compareTo(arg0.getEnd()); if (endCompare != 0) { return endCompare; } } // ..or durations return new TemporalAmountComparator().compare(getDuration(), arg0.getDuration()); }
/** * Compares the specified period with this period. * First, compare the start dates. If they are the same, compare the end dates. * * @param arg0 a period to compare with this one * @return a postive value if this period is greater, negative if the other is * greater, or zero if they are equal */ public final int compareTo(final Period arg0) { // Throws documented exception if type is wrong or parameter is null if (arg0 == null) { throw new ClassCastException("Cannot compare this object to null"); } final int startCompare = getStart().compareTo(arg0.getStart()); if (startCompare != 0) { return startCompare; } // start dates are equal, compare end dates.. else if (duration == null) { final int endCompare = getEnd().compareTo(arg0.getEnd()); if (endCompare != 0) { return endCompare; } } // ..or durations return new TemporalAmountComparator().compare(getDuration(), arg0.getDuration()); }
if(filter.getPeriod().getStart().compareTo(triggerDate)<=0 && filter.getPeriod().getEnd().after(triggerDate)) { return true;
if(filter.getPeriod().getStart().compareTo(triggerDate)<=0 && filter.getPeriod().getEnd().after(triggerDate)) { return true;