org.apache.lucene.spatial.prefix.tree

Class DateRangePrefixTree



  • public class DateRangePrefixTree
    extends NumberRangePrefixTree
    A PrefixTree for date ranges in which the levels of the tree occur at natural periods of time (e.g. years, months, ...). You pass in Calendar objects with the desired fields set and the unspecified fields unset, which conveys the precision. The implementation makes some optimization assumptions about a GregorianCalendar; others could probably be supported easily.

    Warning: If you construct a Calendar and then get something from the object like a field (e.g. year) or milliseconds, then every field is fully set by side-effect. So after setting the fields, pass it to this API first.