* with {@link com.google.ical.values.DateValueImpl#compareTo}.
*/
static long comparable(DateValue dv) {
long comp = (((((long) dv.year()) << 4) + dv.month()) << 5) + dv.day();
if (dv instanceof TimeValue) {
TimeValue tv = (TimeValue) dv;
// We add 1 to comparable for timed values to make sure that timed
// events are distinct from all-day events, in keeping with
// DateValue.compareTo.
// It would be odd if an all day exclusion matched a midnight event on
// the same day, but not one at another time of day.
return (((((comp << 5) + tv.hour()) << 6) + tv.minute()) << 6)
+ tv.second() + 1;
} else {
return comp << 17;
}
}