public class SimplePrimitiveId extends java.lang.Object implements PrimitiveId, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private long |
id |
static java.util.regex.Pattern |
ID_PATTERN |
private OsmPrimitiveType |
type |
Constructor and Description |
---|
SimplePrimitiveId(long id,
OsmPrimitiveType type) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
static SimplePrimitiveId |
fromString(java.lang.String s)
Parses a
SimplePrimitiveId from the string s . |
static java.util.List<SimplePrimitiveId> |
fuzzyParse(java.lang.String s)
Attempts to parse extract any primitive id 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.
|
java.lang.String |
toString() |
private final long id
private final OsmPrimitiveType type
public static final java.util.regex.Pattern ID_PATTERN
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 int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static SimplePrimitiveId fromString(java.lang.String s)
SimplePrimitiveId
from the string s
.s
- the string to be parsed, e.g., n1
, node1
,
w1
, way1
, r1
, rel1
, relation1
.SimplePrimitiveId
java.lang.IllegalArgumentException
- if the string does not match the patternpublic static java.util.List<SimplePrimitiveId> fuzzyParse(java.lang.String s)
s
.s
- the string to be parsed, e.g., n1, w1
, node1 and rel2
.OsmPrimitiveType
s.