Package org.opensolaris.opengrok.analysis

Examples of org.opensolaris.opengrok.analysis.Definitions$Tag


  public static Node buildSampleNode() {
    return buildSampleNode(1);
  }

  public static Way buildSampleWay(long id, long... nodeIds) {
    List<Tag> tags = Arrays.asList(new Tag[] { new Tag("highway", "residential") });
    CommonEntityData entityData = new CommonEntityData(id, 0, new Date(), new OsmUser(1, "nco"), 1l, tags);
    List<WayNode> wayNodes = new ArrayList<WayNode>();
    for (int i = 0; i < nodeIds.length; i++)
      wayNodes.add(new WayNode(nodeIds[i]));
    return new Way(entityData, wayNodes);
View Full Code Here


  public final void testProcessNormalWay() {
    Way way =
      new Way(new CommonEntityData(1234, 2, timestamp, new OsmUser(23, "someuser"), 0));
    way.getWayNodes().add(new WayNode(1235));
    way.getWayNodes().add(new WayNode(1236));
    way.getTags().add(new Tag("waykey", "wayvalue"));
   
    testWayWriter.process(way);
    try {
      testBufferedWriter.flush();
    } catch (IOException e) {
View Full Code Here

  public final void testProcessWayWithNoUser() {
    Way way =
      new Way(new CommonEntityData(1234, 2, timestamp, OsmUser.NONE, 0));
    way.getWayNodes().add(new WayNode(1235));
    way.getWayNodes().add(new WayNode(1236));
    way.getTags().add(new Tag("waykey", "wayvalue"));
   
    testWayWriter.process(way);
    try {
      testBufferedWriter.flush();
    } catch (IOException e) {
View Full Code Here

    Relation relation =
      new Relation(new CommonEntityData(1234, 2, timestamp, new OsmUser(23, "someuser"), 0));
    relation.getMembers().add(new RelationMember(2345, EntityType.Node, "noderole"));
    relation.getMembers().add(new RelationMember(3456, EntityType.Way, "wayrole"));
    relation.getMembers().add(new RelationMember(4567, EntityType.Relation, "relationrole"));
    relation.getTags().add(new Tag("relationkey", "relationvalue"));
   
    testRelationWriter.process(relation);
    try {
      testBufferedWriter.flush();
    } catch (IOException e) {
View Full Code Here

    Relation relation =
      new Relation(new CommonEntityData(1234, 2, timestamp, OsmUser.NONE, 0));
    relation.getMembers().add(new RelationMember(2345, EntityType.Node, "noderole"));
    relation.getMembers().add(new RelationMember(3456, EntityType.Way, "wayrole"));
    relation.getMembers().add(new RelationMember(4567, EntityType.Relation, "relationrole"));
    relation.getTags().add(new Tag("relationkey", "relationvalue"));
   
    testRelationWriter.process(relation);
    try {
      testBufferedWriter.flush();
    } catch (IOException e) {
View Full Code Here

          e);
    }
  }
 
  private Tag readTag() throws Exception {
    Tag tag = new Tag(reader.getAttributeValue(null, ATTRIBUTE_NAME_KEY),
        reader.getAttributeValue(null, ATTRIBUTE_NAME_VALUE));
    reader.nextTag();
    reader.nextTag();
    return tag;
  }
View Full Code Here

   
    writeableContainer = entityContainer.getWriteableInstance();
    entity = writeableContainer.getEntity();
   
    for (Iterator<Tag> i = entity.getTags().iterator(); i.hasNext();) {
      Tag tag;
     
      tag = i.next();
     
      if (keysToDrop.contains(tag.getKey())) {
        i.remove();
      } else {
        for (String prefix : keyPrefixesToDrop) {
          if (tag.getKey().startsWith(prefix)) {
            i.remove();
               break;
          }
        }
      }
View Full Code Here

  @Override
  public DbFeature<Tag> buildEntity(ResultSet resultSet) {
    try {
      return new DbFeature<Tag>(
        resultSet.getLong("entity_id"),
        new Tag(
          resultSet.getString("k"),
          resultSet.getString("v")
        )
      );
     
View Full Code Here

   */
  @Override
  public int populateEntityParameters(PreparedStatement statement, int initialIndex, DbFeature<Tag> entityFeature) {
    try {
      int prmIndex;
      Tag tag;
     
      tag = entityFeature.getFeature();
     
      prmIndex = initialIndex;
     
      statement.setLong(prmIndex++, entityFeature.getEntityId());
      statement.setString(prmIndex++, tag.getKey());
      statement.setString(prmIndex++, tag.getValue());
     
      return prmIndex;
     
    } catch (SQLException e) {
      throw new OsmosisRuntimeException(
View Full Code Here

   
    dbTags = (Map<String, String>) rs.getObject("tags");
    if (dbTags != null) {
      tags = entityData.getTags();
      for (Entry<String, String> tagEntry : dbTags.entrySet()) {
        tags.add(new Tag(tagEntry.getKey(), tagEntry.getValue()));
      }
    }
   
    return entityData;
  }
View Full Code Here

TOP

Related Classes of org.opensolaris.opengrok.analysis.Definitions$Tag

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.