本文整理了Java中org.openstreetmap.osmosis.core.domain.v0_6.Relation.getWriteableInstance
方法的一些代码示例,展示了Relation.getWriteableInstance
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Relation.getWriteableInstance
方法的具体详情如下:
包路径:org.openstreetmap.osmosis.core.domain.v0_6.Relation
类名称:Relation
方法名:getWriteableInstance
暂无
代码示例来源:origin: openstreetmap/osmosis
/**
* {@inheritDoc}
*/
@Override
public RelationContainer getWriteableInstance() {
if (relation.isReadOnly()) {
return new RelationContainer(relation.getWriteableInstance());
} else {
return this;
}
}
}
代码示例来源:origin: org.openstreetmap.osmosis/osmosis-core
/**
* {@inheritDoc}
*/
@Override
public RelationContainer getWriteableInstance() {
if (relation.isReadOnly()) {
return new RelationContainer(relation.getWriteableInstance());
} else {
return this;
}
}
}
代码示例来源:origin: openstreetmap/osmosis
/**
* Relation cloning test.
*/
@Test
public void testRelationClone() {
// Build the original entity.
List<Tag> tags = new ArrayList<Tag>();
tags.add(new Tag("myKey", "myValue"));
List<RelationMember> members = new ArrayList<RelationMember>();
members.add(new RelationMember(1, EntityType.Node, "myRole"));
Relation entity = new Relation(new CommonEntityData(1, 2, new Date(0), OsmUser.NONE, 3, tags), members);
// Cloning a writeable object should return the original object.
Assert.assertSame("Entity was cloned", entity, entity.getWriteableInstance());
// Get a cloned entity.
entity.makeReadOnly();
Relation clonedEntity = entity.getWriteableInstance();
// Make sure we weren't assigned the original entity.
Assert.assertNotSame("Entity was not cloned", entity, clonedEntity);
}
}
内容来源于网络,如有侵权,请联系作者删除!