public enum OsmPrimitiveType extends java.lang.Enum<OsmPrimitiveType>
Enum Constant and Description |
---|
CLOSEDWAY
Closed way: only for display, no real type
|
MULTIPOLYGON
Multipolygon: only for display, no real type
|
NODE
Node type
|
RELATION
Relation type
|
WAY
Way type
|
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
apiTypeName |
private static java.util.Collection<OsmPrimitiveType> |
DATA_VALUES |
private java.lang.Class<? extends PrimitiveData> |
dataClass |
private java.lang.Class<? extends OsmPrimitive> |
osmClass |
Modifier and Type | Method and Description |
---|---|
static java.util.Collection<OsmPrimitiveType> |
dataValues()
Returns the values matching real OSM API data types (node, way, relation).
|
static OsmPrimitiveType |
from(IPrimitive obj)
Determines the OSM primitive type of the given object.
|
static OsmPrimitiveType |
from(java.lang.String value)
Returns enum value from API type name / JOSM display name, case insensitive.
|
static OsmPrimitiveType |
fromApiTypeName(java.lang.String typeName)
Returns enum value from API type name / JOSM display name, case sensitive.
|
java.lang.String |
getAPIName()
Returns the API type name / JOSM display name.
|
java.lang.Class<? extends PrimitiveData> |
getDataClass()
Returns the data class.
|
java.lang.Class<? extends OsmPrimitive> |
getOsmClass()
Returns the OSM class for data values, or null.
|
OsmPrimitive |
newInstance(long uniqueId,
boolean allowNegative)
Constructs a new primitive instance (node, way or relation) without version.
|
OsmPrimitive |
newVersionedInstance(long id,
int version)
Constructs a new primitive instance (node, way or relation) with given version.
|
java.lang.String |
toString() |
static OsmPrimitiveType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static OsmPrimitiveType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final OsmPrimitiveType NODE
public static final OsmPrimitiveType WAY
public static final OsmPrimitiveType RELATION
public static final OsmPrimitiveType CLOSEDWAY
public static final OsmPrimitiveType MULTIPOLYGON
private static final java.util.Collection<OsmPrimitiveType> DATA_VALUES
private final java.lang.String apiTypeName
private final java.lang.Class<? extends OsmPrimitive> osmClass
private final java.lang.Class<? extends PrimitiveData> dataClass
public static OsmPrimitiveType[] values()
for (OsmPrimitiveType c : OsmPrimitiveType.values()) System.out.println(c);
public static OsmPrimitiveType valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic java.lang.String getAPIName()
public java.lang.Class<? extends OsmPrimitive> getOsmClass()
public java.lang.Class<? extends PrimitiveData> getDataClass()
public static OsmPrimitiveType fromApiTypeName(java.lang.String typeName)
typeName
- API type name / JOSM display name, case sensitivejava.lang.IllegalArgumentException
- if the type name does not match any valid typefrom(String)
public static OsmPrimitiveType from(IPrimitive obj)
obj
- the OSM object to inspectobj
java.lang.IllegalArgumentException
- if obj
is null or of unknown typepublic static OsmPrimitiveType from(java.lang.String value)
value
- API type name / JOSM display name, case insensitivefromApiTypeName(java.lang.String)
public static java.util.Collection<OsmPrimitiveType> dataValues()
public OsmPrimitive newInstance(long uniqueId, boolean allowNegative)
uniqueId
- the unique idallowNegative
- true
to allow negative idjava.lang.IllegalArgumentException
- if uniqueId < 0 and allowNegative is falsepublic OsmPrimitive newVersionedInstance(long id, int version)
id
- The id. Must be >= 0version
- The versionjava.lang.IllegalArgumentException
- if id < 0public java.lang.String toString()
toString
in class java.lang.Enum<OsmPrimitiveType>