Package mil.nga.giat.geowave.store.query

Examples of mil.nga.giat.geowave.store.query.TemporalRange


    if (data == null) {
      return null;
    }
    if (data instanceof Date) {
      return toSet(new TemporalRange((Date) data, (Date) data));
    } else if (data instanceof Timestamp) {
      return toSet(new TemporalRange((Timestamp) data, (Timestamp) data));
    } else if (data instanceof Number) {
      long val = ((Number) data).longValue();
      return toSet(new TemporalRange(new Date(val), new Date(val)));
    } else if (data instanceof TemporalRange) {
      return toSet((TemporalRange) data);
    } else if (data instanceof TemporalConstraints) {
      return (TemporalConstraints) data;
    } else if (data instanceof Period) {
      final Position beginPosition = ((Period) data).getBeginning()
          .getPosition();
      final Position endPosition = ((Period) data).getEnding()
          .getPosition();
      Date s = TemporalRange.START_TIME, e = TemporalRange.START_TIME;

      if (beginPosition.getDate() != null)
        s = beginPosition.getDate();
      else if (beginPosition.getTime() != null)
        s = beginPosition.getTime();

      if (endPosition.getDate() != null)
        e = endPosition.getDate();
      else if (endPosition.getTime() != null)
        e = endPosition.getTime();
      return toSet(new TemporalRange(s, e));
    } else if (data instanceof Instant) {
      final Position beginPosition = ((Instant) data).getPosition();
      Date s = TemporalRange.START_TIME;
      if (beginPosition.getDate() != null)
        s = beginPosition.getDate();
      else if (beginPosition.getTime() != null)
        s = beginPosition.getTime();
      return toSet(new TemporalRange(s, s));
    }

    throw new ClassCastException("Could not cast data to TemporalRange");
  }
View Full Code Here


        .getFilter().accept(this, data);
    TemporalConstraints notRanges = new TemporalConstraints();
    Date lastMax = TemporalRange.START_TIME;
    for (TemporalRange range : contraints.getRanges()) {
      if (range.getStartTime().after(TemporalRange.START_TIME)) {
        notRanges.add(new TemporalRange(lastMax, new Date(range
            .getStartTime().getTime() - 1)));
      }
      lastMax = range.getEndTime();
    }
    if (!contraints.isEmpty()
        && (TemporalRange.END_TIME.after(contraints.getEndRange()
            .getEndTime())))
      notRanges.add(new TemporalRange(lastMax, TemporalRange.END_TIME));
    return notRanges;
  }
View Full Code Here

        data));
    TemporalConstraints side2 = btime(after.getExpression2().accept(this,
        data));

    if (!side2.isEmpty())
      return toSet(new TemporalRange(side2.getEndRange().getEndTime(),
          TemporalRange.END_TIME));
    else if (!side1.isEmpty())
      return toSet(new TemporalRange(side1.getEndRange().getEndTime(),
          TemporalRange.END_TIME));
    return side2;
  }
View Full Code Here

        data));
    TemporalConstraints side2 = btime(before.getExpression2().accept(this,
        data));

    if (!side2.isEmpty())
      return toSet(new TemporalRange(TemporalRange.START_TIME, side2
          .getStartRange().getStartTime()));
    else if (!side1.isEmpty())
      return toSet(new TemporalRange(TemporalRange.START_TIME, side1
          .getStartRange().getStartTime()));
    return side2;
  }
View Full Code Here

    TemporalConstraints rightResult = (TemporalConstraints) begins
        .getExpression2().accept(this, data);

    if (leftResult.isEmpty())
      return toSet(new TemporalRange(
          rightResult.getMinOr(TemporalRange.START_TIME),
          TemporalRange.END_TIME));
    if (rightResult.isEmpty())
      return toSet(new TemporalRange(
          leftResult.getMinOr(TemporalRange.START_TIME),
          TemporalRange.END_TIME));

    // Looks like infinity. This case occurs if both sides are parameters or
    // functions.
View Full Code Here

    TemporalConstraints rightResult = (TemporalConstraints) begunBy
        .getExpression2().accept(this, data);

    if (leftResult.isEmpty())
      return toSet(new TemporalRange(
          rightResult.getMinOr(TemporalRange.START_TIME),
          TemporalRange.END_TIME));
    if (rightResult.isEmpty())
      return toSet(new TemporalRange(
          leftResult.getMinOr(TemporalRange.START_TIME),
          TemporalRange.END_TIME));

    // Looks like infinity. This case occurs if both sides are parameters or
    // functions.
View Full Code Here

    TemporalConstraints rightResult = (TemporalConstraints) endedBy
        .getExpression2().accept(this, data);

    if (leftResult.isEmpty())
      return toSet(new TemporalRange(TemporalRange.START_TIME,
          rightResult.getMaxOr(TemporalRange.END_TIME)));
    if (rightResult.isEmpty())
      return toSet(new TemporalRange(TemporalRange.START_TIME,
          leftResult.getMaxOr(TemporalRange.END_TIME)));

    // Looks like infinity. This case occurs if both sides are parameters or
    // functions.
    return infinity();
View Full Code Here

    TemporalConstraints rightResult = (TemporalConstraints) ends
        .getExpression2().accept(this, data);

    if (leftResult.isEmpty())
      return toSet(new TemporalRange(TemporalRange.START_TIME,
          rightResult.getMaxOr(TemporalRange.END_TIME)));
    if (rightResult.isEmpty())
      return toSet(new TemporalRange(TemporalRange.START_TIME,
          leftResult.getMaxOr(TemporalRange.END_TIME)));

    // Looks like infinity. This case occurs if both sides are parameters or
    // functions.
    return infinity();
View Full Code Here

    TemporalConstraints rightResult = (TemporalConstraints) meets
        .getExpression2().accept(this, data);

    if (leftResult.isEmpty())
      return toSet(new TemporalRange(TemporalRange.START_TIME,
          rightResult.getMinOr(TemporalRange.END_TIME)));
    if (rightResult.isEmpty())
      return toSet(new TemporalRange(
          leftResult.getMaxOr(TemporalRange.START_TIME),
          TemporalRange.END_TIME));

    // Looks like infinity. This case occurs if both sides are parameters or
    // functions.
    return toSet(new TemporalRange(
        leftResult.getMinOr(TemporalRange.START_TIME),
        rightResult.getMaxOr(TemporalRange.END_TIME)));
  }
View Full Code Here

TOP

Related Classes of mil.nga.giat.geowave.store.query.TemporalRange

Copyright © 2018 www.massapicom. 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.