Package org.kitesdk.data.spi.predicates

Examples of org.kitesdk.data.spi.predicates.Range$Bound


  }

  public Constraints from(String name, Comparable value) {
    SchemaUtil.checkTypeConsistency(schema, strategy, name, value);
    checkContained(name, value);
    Range added = Ranges.atLeast(value);
    return new Constraints(this, name, combine(constraints.get(name), added));
  }
View Full Code Here


  }

  public Constraints fromAfter(String name, Comparable value) {
    SchemaUtil.checkTypeConsistency(schema, strategy, name, value);
    checkContained(name, value);
    Range added = Ranges.greaterThan(value);
    return new Constraints(this, name, combine(constraints.get(name), added));
  }
View Full Code Here

  }

  public Constraints to(String name, Comparable value) {
    SchemaUtil.checkTypeConsistency(schema, strategy, name, value);
    checkContained(name, value);
    Range added = Ranges.atMost(value);
    return new Constraints(this, name, combine(constraints.get(name), added));
  }
View Full Code Here

  }

  public Constraints toBefore(String name, Comparable value) {
    SchemaUtil.checkTypeConsistency(schema, strategy, name, value);
    checkContained(name, value);
    Range added = Ranges.lessThan(value);
    return new Constraints(this, name, combine(constraints.get(name), added));
  }
View Full Code Here

    if (predicate instanceof Exists) {
      return Predicates.exists();
    } else if (predicate instanceof In) {
      return ((In<S>) predicate).transform(this);
    } else if (predicate instanceof Range) {
      Range range = (Range) predicate;
      Set<Integer> possibleValues = Sets.newHashSet();
      for (int i = 0; i < values.size(); i += 1) {
        Set<S> items = values.get(i);
        if (items.size() == Integer.MAX_VALUE) {
          // items may not be finite, do not consider each item
          possibleValues.add(i);
        } else {
          // check each item in the set
          for (S item : items) {
            if (range.contains(item)) {
              possibleValues.add(i);
              break; // no need to test additional items in this set
            }
          }
        }
View Full Code Here

   */
  public void setOrigin(OSMData osmData) {
   
    if (osmData.getBounds() != null && !osmData.getBounds().isEmpty()) {
     
      Bound firstBound = osmData.getBounds().iterator().next();
     
      setOrigin(new LatLon(
          (firstBound.getTop() + firstBound.getBottom()) / 2,
          (firstBound.getLeft() + firstBound.getRight()) / 2));
     
    } else {
     
      if (osmData.getNodes().isEmpty()) {
        throw new IllegalArgumentException(
View Full Code Here

   */
  @Test
  public final void testProcess1() {
    BoundWriter bw = new BoundWriter("bound", 2, true);
    bw.setWriter(testBufferedWriter);
    bw.process(new Bound(20.123456, -21.987654, 22.555555, -23.234567, "originstring"));
    try {
      testBufferedWriter.flush();
    } catch (IOException e) {
      e.printStackTrace();
      fail("IOException");
View Full Code Here

   */
  @Test
  public final void testProcess2() {
    BoundWriter bw = new BoundWriter("bound", 2, true);
    bw.setWriter(testBufferedWriter);
    bw.process(new Bound(20.123456, -21.987654, 22.555555, -23.234567, ""));
    try {
      testBufferedWriter.flush();
    } catch (IOException e) {
      e.printStackTrace();
      fail("IOException");
View Full Code Here

      initialize();
    }
   
    // Build the bounds list.
    bounds = new ArrayList<Bound>();
    bounds.add(new Bound("Osmosis " + OsmosisConstants.VERSION));
   
    sources = new ArrayList<ReleasableIterator<EntityContainer>>();
   
    sources.add(new UpcastIterator<EntityContainer, BoundContainer>(
        new BoundContainerIterator(new ReleasableAdaptorForIterator<Bound>(bounds.iterator()))));
View Full Code Here

      initialize();
    }
   
    // Build the bounds list.
    bounds = new ArrayList<Bound>();
    bounds.add(new Bound(right, left, top, bottom, "Osmosis " + OsmosisConstants.VERSION));
   
    // PostgreSQL sometimes incorrectly chooses to perform full table scans, these options
    // prevent this. Note that this is not recommended practice according to documentation
    // but fixing this would require modifying the table statistics gathering
    // configuration to produce better plans.
View Full Code Here

TOP

Related Classes of org.kitesdk.data.spi.predicates.Range$Bound

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.