Package org.mongojack.internal.object

Examples of org.mongojack.internal.object.BsonObjectGenerator$Node


   */
  @Override
  public void process(CommonEntityData data, ResultSet resultSet) throws SQLException {
    double latitude;
    double longitude;
    Node node;
   
    latitude = FixedPrecisionCoordinateConvertor.convertToDouble(resultSet.getInt("latitude"));
        longitude = FixedPrecisionCoordinateConvertor.convertToDouble(resultSet.getInt("longitude"));
   
        node = new Node(data, latitude, longitude);
       
        listener.process(node, resultSet);
  }
View Full Code Here


  public void removeExistingBoundTest() {
    SinkEntityInspector inspector = new SinkEntityInspector();
    BoundSetter setter = new BoundSetter(null);
    setter.setSink(inspector);
    setter.process(new BoundContainer(new Bound("Test")));
    setter.process(new NodeContainer(new Node(
        new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1)));
    setter.complete();
    setter.release();
   
    EntityContainer ec = inspector.getProcessedEntities().iterator().next();
View Full Code Here

  @Test
  public void removeNoBoundTest() {
    SinkEntityInspector inspector = new SinkEntityInspector();
    BoundSetter setter = new BoundSetter(null);
    setter.setSink(inspector);
    setter.process(new NodeContainer(new Node(
        new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1)));
    setter.complete();
    setter.release();
   
    EntityContainer ec = inspector.getProcessedEntities().iterator().next();
View Full Code Here

    SinkEntityInspector inspector = new SinkEntityInspector();
    Bound newBound = new Bound(2, 1, 4, 3, "NewBound");
    BoundSetter setter = new BoundSetter(newBound);
    setter.setSink(inspector);
    setter.process(new BoundContainer(new Bound("Test")));
    setter.process(new NodeContainer(new Node(
        new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1)));
    setter.complete();
    setter.release();
   
    Iterator<EntityContainer> iterator = inspector.getProcessedEntities().iterator();
View Full Code Here

  public void setNewBoundTest() {
    SinkEntityInspector inspector = new SinkEntityInspector();
    Bound newBound = new Bound(2, 1, 4, 3, "NewBound");
    BoundSetter setter = new BoundSetter(newBound);
    setter.setSink(inspector);
    setter.process(new NodeContainer(new Node(
        new CommonEntityData(1, 1, new Date(), OsmUser.NONE, 1), 1, 1)));
    setter.complete();
    setter.release();
   
    EntityContainer ec = inspector.getProcessedEntities().iterator().next();
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void process(NodeContainer container) {
    Node node = container.getEntity();

    boolean matchesFilter = false;
    for (Tag tag : node.getTags()) {
      if (allowedKeys.contains(tag.getKey())) {
        matchesFilter = true;
        break;
      }
    }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public void process(NodeContainer container) {
    Node node = container.getEntity();

    boolean matchesFilter = false;
    for (Tag tag : node.getTags()) {
      String keyValue = tag.getKey() + "." + tag.getValue();
      if (allowedKeyValues.contains(keyValue)) {
        matchesFilter = true;
        break;
      }
View Full Code Here

            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);
    edgeNodeSouth = new Node(new CommonEntityData(1239, 0, new Date(), user, 0, tags), -20, 10);
  }
View Full Code Here

    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 writing out a normal Node element.
   */
  @Test
  public final void testProcessNormalNode() {
    Node node =
      new Node(
        new CommonEntityData(1234, 2, timestamp, new OsmUser(23, "someuser"), 0),
        20.12345678, -21.98765432);
    node.getTags().add(new Tag("nodekey", "nodevalue"));
    testNodeWriter.process(node);
    try {
      testBufferedWriter.flush();
    } catch (IOException e) {
      e.printStackTrace();
View Full Code Here

TOP

Related Classes of org.mongojack.internal.object.BsonObjectGenerator$Node

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.