public class SimplePrimitiveId extends Object implements PrimitiveId, Serializable
Modifier and Type | Field and Description |
---|---|
private long |
id |
static Pattern |
ID_PATTERN |
static Pattern |
MULTIPLE_IDS_PATTERN |
private static long |
serialVersionUID |
private OsmPrimitiveType |
type |
Constructor and Description |
---|
SimplePrimitiveId(long id,
OsmPrimitiveType type) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
private static List<SimplePrimitiveId> |
extractIdsInto(MatchResult m,
List<SimplePrimitiveId> ids) |
static SimplePrimitiveId |
fromString(String s)
Parses a
SimplePrimitiveId from the string s . |
static List<SimplePrimitiveId> |
fuzzyParse(String s)
Attempts to parse extract any primitive id from the string
s . |
private static OsmPrimitiveType |
getOsmPrimitiveType(char firstChar) |
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.
|
static List<SimplePrimitiveId> |
multipleFromString(String s)
Parses a range
SimplePrimitiveId from the string s . |
String |
toString() |
private static final long serialVersionUID
private final long id
private final OsmPrimitiveType type
public static final Pattern ID_PATTERN
public static final Pattern MULTIPLE_IDS_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 static SimplePrimitiveId fromString(String s)
SimplePrimitiveId
from the string s
.s
- the string to be parsed, e.g., n1
, node1
,
w1
, way1
, r1
, rel1
, relation1
.SimplePrimitiveId
IllegalArgumentException
- if the string does not match the patternpublic static List<SimplePrimitiveId> multipleFromString(String s)
SimplePrimitiveId
from the string s
.s
- the string to be parsed, e.g., node1
, node1-7
, node70-7
.SimplePrimitiveId
sIllegalArgumentException
- if the string does not match the patternpublic static List<SimplePrimitiveId> fuzzyParse(String s)
s
.s
- the string to be parsed, e.g., "n1, w1"
, "node1 and rel2"
, "node 123-29"
.OsmPrimitiveType
s.private static List<SimplePrimitiveId> extractIdsInto(MatchResult m, List<SimplePrimitiveId> ids)
private static OsmPrimitiveType getOsmPrimitiveType(char firstChar)