org.openstreetmap.osmosis.core.domain.v0_6.Relation.getVersion()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(8.6k)|赞(0)|评价(0)|浏览(124)

本文整理了Java中org.openstreetmap.osmosis.core.domain.v0_6.Relation.getVersion方法的一些代码示例,展示了Relation.getVersion的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Relation.getVersion方法的具体详情如下:
包路径:org.openstreetmap.osmosis.core.domain.v0_6.Relation
类名称:Relation
方法名:getVersion

Relation.getVersion介绍

暂无

代码示例

代码示例来源:origin: openstreetmap/osmosis

/**
 * {@inheritDoc}
 */
@Override
public int hashCode() {
  /*
   * As per the hashCode definition, this doesn't have to be unique it
   * just has to return the same value for any two objects that compare
   * equal. Using both id and version will provide a good distribution of
   * values but is simple to calculate.
   */
  return (int) getId() + getVersion();
}

代码示例来源:origin: org.openstreetmap.osmosis/osmosis-core

/**
 * {@inheritDoc}
 */
@Override
public int hashCode() {
  /*
   * As per the hashCode definition, this doesn't have to be unique it
   * just has to return the same value for any two objects that compare
   * equal. Using both id and version will provide a good distribution of
   * values but is simple to calculate.
   */
  return (int) getId() + getVersion();
}

代码示例来源:origin: openstreetmap/osmosis

/**
 * Sets relation values as bind variable parameters to a relation insert query.
 *
 * @param statement The prepared statement to add the values to.
 * @param initialIndex The offset index of the first variable to set.
 * @param relation The way containing the data to be inserted.
 */
private void populateRelationParameters(PreparedStatement statement, int initialIndex, Relation relation) {
  int prmIndex;
  prmIndex = initialIndex;
  assertEntityHasTimestamp(relation);
  try {
    statement.setLong(prmIndex++, relation.getId());
    statement.setTimestamp(prmIndex++, new Timestamp(relation.getTimestamp().getTime()));
    statement.setInt(prmIndex++, relation.getVersion());
    statement.setBoolean(prmIndex++, true);
    statement.setLong(prmIndex++, relation.getChangesetId());
  } catch (SQLException e) {
    throw new OsmosisRuntimeException("Unable to set a prepared statement parameter for a relation.", e);
  }
}

代码示例来源:origin: org.openstreetmap.osmosis/osmosis-apidb

/**
 * Sets relation values as bind variable parameters to a relation insert query.
 *
 * @param statement The prepared statement to add the values to.
 * @param initialIndex The offset index of the first variable to set.
 * @param relation The way containing the data to be inserted.
 */
private void populateRelationParameters(PreparedStatement statement, int initialIndex, Relation relation) {
  int prmIndex;
  prmIndex = initialIndex;
  assertEntityHasTimestamp(relation);
  try {
    statement.setLong(prmIndex++, relation.getId());
    statement.setTimestamp(prmIndex++, new Timestamp(relation.getTimestamp().getTime()));
    statement.setInt(prmIndex++, relation.getVersion());
    statement.setBoolean(prmIndex++, true);
    statement.setLong(prmIndex++, relation.getChangesetId());
  } catch (SQLException e) {
    throw new OsmosisRuntimeException("Unable to set a prepared statement parameter for a relation.", e);
  }
}

代码示例来源:origin: openstreetmap/osmosis

/**
   * Process the relation members.
   * 
   * @param relation The relation to be processed.
   */
  private void addRelationMembers(Relation relation) {
    List<RelationMember> memberReferenceList;

    memberReferenceList = relation.getMembers();

    for (int i = 0; i < memberReferenceList.size(); i++) {
      relationMemberBuffer.add(new DbFeatureHistory<DbOrderedFeature<RelationMember>>(
          new DbOrderedFeature<RelationMember>(relation.getId(), memberReferenceList.get(i), i + 1), relation
              .getVersion()));
    }

    flushRelationMembers(false);
  }
}

代码示例来源:origin: org.openstreetmap.osmosis/osmosis-apidb

/**
   * Process the relation members.
   * 
   * @param relation The relation to be processed.
   */
  private void addRelationMembers(Relation relation) {
    List<RelationMember> memberReferenceList;

    memberReferenceList = relation.getMembers();

    for (int i = 0; i < memberReferenceList.size(); i++) {
      relationMemberBuffer.add(new DbFeatureHistory<DbOrderedFeature<RelationMember>>(
          new DbOrderedFeature<RelationMember>(relation.getId(), memberReferenceList.get(i), i + 1), relation
              .getVersion()));
    }

    flushRelationMembers(false);
  }
}

代码示例来源:origin: openstreetmap/osmosis

/**
 * Process the relation tags.
 * 
 * @param relation The relation to be processed.
 */
private void addRelationTags(Relation relation) {
  for (Tag tag : relation.getTags()) {
    relationTagBuffer.add(new DbFeatureHistory<DbFeature<Tag>>(new DbFeature<Tag>(relation.getId(), tag),
        relation.getVersion()));
  }
  flushRelationTags(false);
}

代码示例来源:origin: org.openstreetmap.osmosis/osmosis-apidb

/**
 * Process the relation tags.
 * 
 * @param relation The relation to be processed.
 */
private void addRelationTags(Relation relation) {
  for (Tag tag : relation.getTags()) {
    relationTagBuffer.add(new DbFeatureHistory<DbFeature<Tag>>(new DbFeature<Tag>(relation.getId(), tag),
        relation.getVersion()));
  }
  flushRelationTags(false);
}

代码示例来源:origin: openstreetmap/osmosis

if (this.getVersion() < comparisonRelation.getVersion()) {
  return -1;
if (this.getVersion() > comparisonRelation.getVersion()) {
  return 1;

代码示例来源:origin: org.openstreetmap.osmosis/osmosis-core

if (this.getVersion() < comparisonRelation.getVersion()) {
  return -1;
if (this.getVersion() > comparisonRelation.getVersion()) {
  return 1;

代码示例来源:origin: openstreetmap/osmosis

prmIndex = 1;
deleteRelationTagStatement.setLong(prmIndex++, relation.getId());
deleteRelationTagStatement.setInt(prmIndex++, relation.getVersion());
prmIndex = 1;
deleteRelationMemberStatement.setLong(prmIndex++, relation.getId());
deleteRelationMemberStatement.setInt(prmIndex++, relation.getVersion());
exists = checkIfEntityHistoryExists(selectRelationCountStatement, relation.getId(), relation.getVersion());
  updateRelationStatement.setLong(prmIndex++, relation.getChangesetId());
  updateRelationStatement.setLong(prmIndex++, relation.getId());
  updateRelationStatement.setInt(prmIndex++, relation.getVersion());
  prmIndex = 1;
  insertRelationStatement.setLong(prmIndex++, relation.getId());
  insertRelationStatement.setInt(prmIndex++, relation.getVersion());
  insertRelationStatement.setTimestamp(prmIndex++, new Timestamp(relation.getTimestamp().getTime()));
  insertRelationStatement.setBoolean(prmIndex++, visible);
  prmIndex = 1;
  insertRelationTagStatement.setLong(prmIndex++, relation.getId());
  insertRelationTagStatement.setInt(prmIndex++, relation.getVersion());
  insertRelationTagStatement.setString(prmIndex++, tag.getKey());
  insertRelationTagStatement.setString(prmIndex++, tag.getValue());
  prmIndex = 1;
  insertRelationMemberStatement.setLong(prmIndex++, relation.getId());
  insertRelationMemberStatement.setInt(prmIndex++, relation.getVersion());

代码示例来源:origin: org.openstreetmap.osmosis/osmosis-apidb

prmIndex = 1;
deleteRelationTagStatement.setLong(prmIndex++, relation.getId());
deleteRelationTagStatement.setInt(prmIndex++, relation.getVersion());
prmIndex = 1;
deleteRelationMemberStatement.setLong(prmIndex++, relation.getId());
deleteRelationMemberStatement.setInt(prmIndex++, relation.getVersion());
exists = checkIfEntityHistoryExists(selectRelationCountStatement, relation.getId(), relation.getVersion());
  updateRelationStatement.setLong(prmIndex++, relation.getChangesetId());
  updateRelationStatement.setLong(prmIndex++, relation.getId());
  updateRelationStatement.setInt(prmIndex++, relation.getVersion());
  prmIndex = 1;
  insertRelationStatement.setLong(prmIndex++, relation.getId());
  insertRelationStatement.setInt(prmIndex++, relation.getVersion());
  insertRelationStatement.setTimestamp(prmIndex++, new Timestamp(relation.getTimestamp().getTime()));
  insertRelationStatement.setBoolean(prmIndex++, visible);
  prmIndex = 1;
  insertRelationTagStatement.setLong(prmIndex++, relation.getId());
  insertRelationTagStatement.setInt(prmIndex++, relation.getVersion());
  insertRelationTagStatement.setString(prmIndex++, tag.getKey());
  insertRelationTagStatement.setString(prmIndex++, tag.getValue());
  prmIndex = 1;
  insertRelationMemberStatement.setLong(prmIndex++, relation.getId());
  insertRelationMemberStatement.setInt(prmIndex++, relation.getVersion());

代码示例来源:origin: openstreetmap/osmosis

/**
 * {@inheritDoc}
 */
public void process(RelationContainer relationContainer) {
  Relation relation;
  int memberSequenceId;
  
  relation = relationContainer.getEntity();
  
  relationWriter.writeField(relation.getId());
  relationWriter.writeField(relation.getVersion());
  relationWriter.writeField(relation.getUser().getId());
  relationWriter.writeField(relation.getTimestamp());
  relationWriter.writeField(relation.getChangesetId());
  relationWriter.writeField(buildTags(relation));
  relationWriter.endRecord();
  
  memberSequenceId = 0;
  for (RelationMember member : relation.getMembers()) {
    relationMemberWriter.writeField(relation.getId());
    relationMemberWriter.writeField(member.getMemberId());
    relationMemberWriter.writeField(memberTypeValueMapper.getMemberType(member.getMemberType()));
    relationMemberWriter.writeField(member.getMemberRole());
    relationMemberWriter.writeField(memberSequenceId++);
    relationMemberWriter.endRecord();
  }
}

代码示例来源:origin: openstreetmap/osmosis

relationWriter.writeField(relation.getVersion());
relationWriter.writeField(relation.getUser().getId());
relationWriter.writeField(relation.getTimestamp());

相关文章