Example usage for org.apache.lucene.spatial.prefix.tree DateRangePrefixTree toUnitShape

List of usage examples for org.apache.lucene.spatial.prefix.tree DateRangePrefixTree toUnitShape

Introduction

In this page you can find the example usage for org.apache.lucene.spatial.prefix.tree DateRangePrefixTree toUnitShape.

Prototype

@Override
public UnitNRShape toUnitShape(Object value) 

Source Link

Document

Converts value from a Calendar or Date to a Shape .

Usage

From source file:com.stratio.cassandra.lucene.schema.mapping.BitemporalMapper.java

License:Apache License

/**
 * Build a {@link NRShape}.//from   ww  w .jav  a  2  s.  c  o  m
 *
 * @param tree  The {@link DateRangePrefixTree} tree.
 * @param start The {@link BitemporalDateTime} start of the range.
 * @param stop  The {@link BitemporalDateTime} stop of the range.
 * @return A built {@link NRShape}.
 */
public NRShape makeShape(DateRangePrefixTree tree, BitemporalDateTime start, BitemporalDateTime stop) {
    UnitNRShape startShape = tree.toUnitShape(start.toDate());
    UnitNRShape stopShape = tree.toUnitShape(stop.toDate());
    return tree.toRangeShape(startShape, stopShape);
}