public class SimplePrimitiveId extends Object implements PrimitiveId, Serializable
Modifier and Type | Field and Description |
---|---|
private long |
id |
private OsmPrimitiveType |
type |
Constructor and Description |
---|
SimplePrimitiveId(long id,
OsmPrimitiveType type) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
static SimplePrimitiveId |
fromString(String s)
Parses a
OsmPrimitiveType from the string s . |
OsmPrimitiveType |
getType()
Gets the type of object represented by this object.
|
long |
getUniqueId()
Gets a unique id representing this object (the OSM server id for OSM objects)
|
int |
hashCode() |
boolean |
isNew()
Replies true if this id represents a new primitive.
|
String |
toString() |
private final long id
private final OsmPrimitiveType type
public SimplePrimitiveId(long id, OsmPrimitiveType type)
public OsmPrimitiveType getType()
PrimitiveId
getType
in interface PrimitiveId
Node
,
Way
,
Relation
public long getUniqueId()
PrimitiveId
getUniqueId
in interface PrimitiveId
public boolean isNew()
PrimitiveId
isNew
in interface PrimitiveId
public static SimplePrimitiveId fromString(String s)
OsmPrimitiveType
from the string s
.s
- the string to be parsed, e.g., n1
, node1
,
w1
, way1
, r1
, rel1
, relation1
.OsmPrimitiveType
IllegalArgumentException
- if the string does not match the pattern