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

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


    throw new ClassCastException("Could not cast data to TemporalRange");
  }

  @Override
  public Object visit(final ExcludeFilter filter, final Object data) {
    return new TemporalConstraints();
  }
View Full Code Here


  public Object visit(final IncludeFilter filter, final Object data) {
    return infinity();
  }

  private TemporalConstraints infinity() {
    return new TemporalConstraints();
    //toSet(new TemporalRange(TemporalRange.START_TIME, new Date(
    //    Long.MAX_VALUE)));
  }
View Full Code Here

    //toSet(new TemporalRange(TemporalRange.START_TIME, new Date(
    //    Long.MAX_VALUE)));
  }

  private TemporalConstraints toSet(TemporalRange range) {
    TemporalConstraints contraints = new TemporalConstraints();
    contraints.add(range);
    return contraints;
  }
View Full Code Here

    return btime(value);
  }

  @Override
  public Object visit(final And filter, final Object data) {
    TemporalConstraints ranges;
    TemporalConstraints lastRanges = null;
    for (final Filter f : filter.getChildren()) {
      ranges = (TemporalConstraints) f.accept(this, data);
      if (lastRanges != null) {
        lastRanges = TemporalConstraints.findIntersections(lastRanges,
            ranges);
View Full Code Here

    return lastRanges;
  }

  @Override
  public Object visit(final Not filter, final Object data) {
    TemporalConstraints contraints = (TemporalConstraints) filter
        .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

    return notRanges;
  }

  @Override
  public Object visit(final Or filter, final Object data) {
    TemporalConstraints ranges;
    TemporalConstraints newSetOfRanges = new TemporalConstraints();

    for (final Filter f : filter.getChildren()) {
      ranges = (TemporalConstraints) f.accept(this, data);
      for (TemporalRange range : ranges.getRanges()) {
        newSetOfRanges.add(range);
      }
    }
    return newSetOfRanges;
  }
View Full Code Here

    }
    return newSetOfRanges;
  }

  public Object visit(After after, Object data) {
    TemporalConstraints side1 = btime(after.getExpression1().accept(this,
        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

  public Object visit(AnyInteracts anyInteracts, Object data) {
    return infinity();
  }

  public Object visit(Before before, Object data) {
    TemporalConstraints side1 = btime(before.getExpression1().accept(this,
        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

          .getStartRange().getStartTime()));
    return side2;
  }

  public Object visit(Begins begins, Object data) {
    TemporalConstraints leftResult = (TemporalConstraints) begins
        .getExpression1().accept(this, data);

    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
View Full Code Here

    // functions.
    return infinity();
  }

  public Object visit(BegunBy begunBy, Object data) {
    TemporalConstraints leftResult = (TemporalConstraints) begunBy
        .getExpression1().accept(this, data);

    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
View Full Code Here

TOP

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

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.