コード例 #1
0
  private void process(OsmRelation relation) {
    boolean hasChildRelations = false;
    TLongList childRelationMembers = new TLongArrayList();
    for (OsmRelationMember member : OsmModelUtil.membersAsList(relation)) {
      if (member.getType() == EntityType.Relation) {
        hasChildRelations = true;
        idsIsChildRelation.add(member.getId());
        childRelationMembers.add(member.getId());
        if (storeSimpleRelations) {
          idsSimpleRelations.remove(member.getId());
        }
      }
    }
    long id = relation.getId();
    if (hasChildRelations) {
      idsHasChildRelations.add(id);
      if (!graph.getNodes().contains(id)) {
        graph.addNode(id);
      }

      TLongIterator iterator = childRelationMembers.iterator();
      while (iterator.hasNext()) {
        long member = iterator.next();
        if (!graph.getNodes().contains(member)) {
          graph.addNode(member);
        }
        graph.addEdge(id, member);
      }
    } else {
      if (storeSimpleRelations && !idsIsChildRelation.contains(id)) {
        idsSimpleRelations.add(id);
      }
      numNoChildren++;
    }
  }
コード例 #2
0
 /**
  * Deletes a value from the set.
  *
  * @param value an <code>Object</code> value
  * @return true if the set was modified
  */
 @Override
 public boolean remove(Object value) {
   return value instanceof Long && _set.remove(((Long) value).longValue());
 }
コード例 #3
0
 public long pop() {
   long value = stack.pop();
   set.remove(value);
   return value;
 }