Package java1.util.regex

Examples of java1.util.regex.Pattern$Bound


      entityContainer1 = nextOrNull(postbox1);
         
      // There's only need for special processing if there actually is some data
      // on both streams - no data implies no bound
      if (entityContainer0 != null && entityContainer1 != null) {
        Bound bound0 = null;
        Bound bound1 = null;
       
        // If there are any bounds upstream, eat them up
        if (entityContainer0.getEntity().getType() == EntityType.Bound) {
          bound0 = (Bound) entityContainer0.getEntity();
          entityContainer0 = nextOrNull(postbox0);
View Full Code Here


            false,
            false,
            false,
            false);
    simpleAreaFilter.setSink(entityInspector);
    intersectingBound = new Bound(30, 10, 30, 10, "intersecting");
    nonIntersectingBound = new Bound(-30, -50, 10, -10, "nonintersecting");
    inAreaNode = new Node(new CommonEntityData(1234, 0, new Date(), user, 0, tags), 10, 10);
    outOfAreaNode = new Node(new CommonEntityData(1235, 0, new Date(), user, 0, tags), 30, 30);
    edgeNodeEast = new Node(new CommonEntityData(1236, 0, new Date(), user, 0, tags), 10, 20);
    edgeNodeWest = new Node(new CommonEntityData(1237, 0, new Date(), user, 0, tags), 10, -20);
    edgeNodeNorth = new Node(new CommonEntityData(1238, 0, new Date(), user, 0, tags), 20, 10);
View Full Code Here

  /**
   * Test passing a Bound which intersects the filter area.
   */
  @Test
  public final void testProcessBoundContainer1() {
    Bound compareBound;
    simpleAreaFilter.process(new BoundContainer(intersectingBound));
    simpleAreaFilter.complete();
    compareBound = (Bound) entityInspector.getLastEntityContainer().getEntity();
    assertTrue(Double.compare(compareBound.getRight(), 20) == 0);
    assertTrue(Double.compare(compareBound.getLeft(), 10) == 0);
    assertTrue(Double.compare(compareBound.getTop(), 20) == 0);
    assertTrue(Double.compare(compareBound.getBottom(), 10) == 0);
    assertTrue(compareBound.getOrigin().equals("intersecting"));
  }
View Full Code Here

    polygonFile = new File(getClass().getResource("testPolygon.txt").getFile());
    entityInspector = new SinkEntityInspector();
    // polyAreaFilter has a notch out of the Northeast corner.
    polyAreaFilter = new PolygonFilter(IdTrackerType.Dynamic, polygonFile, false, false, false, false);
    polyAreaFilter.setSink(entityInspector);
    intersectingBound = new Bound(30, 0, 30, 0, "intersecting");
    crossingIntersectingBound = new Bound(-10, 10, 30, -30, "crossing intersecting");
    nonIntersectingBound = new Bound(30, 15, 30, 15, "nonintersecting");
    inAreaNode = new Node(new CommonEntityData(1234, 0, new Date(), user, 0, tags), 5, 10);
    outOfAreaNode = new Node(new CommonEntityData(1235, 0, new Date(), user, 0, tags), 15, 15);
    edgeNode = new Node(new CommonEntityData(1236, 0, new Date(), user, 0, tags), 15, 10);
  }
View Full Code Here

  /**
   * Test passing a Bound which intersects the filter area.
   */
  @Test
  public final void testProcessBoundContainer1() {
    Bound compareBound;
    polyAreaFilter.process(new BoundContainer(intersectingBound));
    polyAreaFilter.complete();
    compareBound = (Bound) entityInspector.getLastEntityContainer().getEntity();
    assertTrue(Double.compare(compareBound.getRight(), 20) == 0);
    assertTrue(Double.compare(compareBound.getLeft(), 0) == 0);
    assertTrue(Double.compare(compareBound.getTop(), 20) == 0);
    assertTrue(Double.compare(compareBound.getBottom(), 0) == 0);
    assertTrue(compareBound.getOrigin().equals("intersecting"));
  }
View Full Code Here

  /**
   * Test passing a Bound which crosses the antimeredian and intersects the filter area.
   */
  @Test
  public final void testProcessBoundContainer2() {
    Bound compareBound;
    polyAreaFilter.process(new BoundContainer(crossingIntersectingBound));
    polyAreaFilter.complete();
    compareBound = (Bound) entityInspector.getLastEntityContainer().getEntity();
    assertTrue(Double.compare(compareBound.getRight(), 20) == 0);
    assertTrue(Double.compare(compareBound.getLeft(), -20) == 0);
    assertTrue(Double.compare(compareBound.getTop(), 20) == 0);
    assertTrue(Double.compare(compareBound.getBottom(), -20) == 0);
    assertTrue(compareBound.getOrigin().equals("crossing intersecting"));
  }
View Full Code Here

  public final void testBoundElement1() {
    parseString(OSM_PREFIX
            + "<bound box=\"-12.34567,-23.45678,34.56789,45.67891\""
            + " origin=\"someorigin\"/>"
            + OSM_SUFFIX);
    Bound b = (Bound) entityInspector.getLastEntityContainer().getEntity();
    assertTrue(Double.compare(b.getRight(), 45.67891) == 0
            && Double.compare(b.getLeft(), -23.45678) == 0
            && Double.compare(b.getTop(), 34.56789) == 0
            && Double.compare(b.getBottom(), -12.34567) == 0);
    assertTrue(b.getOrigin().equals("someorigin"));
  }
View Full Code Here

  @Test
  public void testBoundsNoOrigin() {
    parseString(OSM_PREFIX
        + "<bounds minlat=\"-1.234\" minlon=\"-1.234\" maxlat=\"1.234\" maxlon=\"1.234\"/>"
        + OSM_SUFFIX);
    Bound b = (Bound) entityInspector.getLastEntityContainer().getEntity();
    assertEquals(-1.234, b.getLeft(), 1E-6);
    assertEquals(-1.234, b.getBottom(), 1E-6);
    assertEquals(1.234, b.getRight(), 1E-6);
    assertEquals(1.234, b.getTop(), 1E-6);
    assertNull(b.getOrigin());
  }
View Full Code Here

  public void testBoundsWithOrigin() {
    parseString(OSM_PREFIX
        + "<bounds minlat=\"-1\" minlon=\"-1\" maxlat=\"1\" maxlon=\"1\" "
        + " origin=\"someorigin\"/>"
        + OSM_SUFFIX);
    Bound b = (Bound) entityInspector.getLastEntityContainer().getEntity();
    assertEquals("someorigin", b.getOrigin());
  }
View Full Code Here

    if (unsupportedFeatures.size() > 0) {
      throw new OsmosisRuntimeException("PBF file contains unsupported features " + unsupportedFeatures);
    }

    // Build a new bound object which corresponds to the header.
    Bound bound;
    if (header.hasBbox()) {
      HeaderBBox bbox = header.getBbox();
      bound = new Bound(bbox.getRight() * COORDINATE_SCALING_FACTOR, bbox.getLeft() * COORDINATE_SCALING_FACTOR,
          bbox.getTop() * COORDINATE_SCALING_FACTOR, bbox.getBottom() * COORDINATE_SCALING_FACTOR,
          header.getSource());
    } else {
      bound = new Bound(header.getSource());
    }

    // Add the bound object to the results.
    decodedEntities.add(new BoundContainer(bound));
  }
View Full Code Here

TOP

Related Classes of java1.util.regex.Pattern$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.