Package org.openstreetmap.josm.data.osm
Enum Class OsmPrimitiveType
- All Implemented Interfaces:
Serializable,Comparable<OsmPrimitiveType>,Constable
OSM primitive type.
- Since:
- 1670
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionClosed way: only for display, no real typeMultipolygon: only for display, no real typeNode typeRelation typeWay type -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate static final Collection<OsmPrimitiveType>private final Class<? extends PrimitiveData>private final UniqueIdGeneratorprivate final Class<? extends OsmPrimitive> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateOsmPrimitiveType(String apiTypeName, Class<? extends OsmPrimitive> osmClass, Class<? extends PrimitiveData> dataClass, UniqueIdGenerator idGenerator) -
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<OsmPrimitiveType>Returns the values matching real OSM API data types (node, way, relation).static OsmPrimitiveTypeReturns enum value from API type name / JOSM display name, case insensitive.static OsmPrimitiveTypefrom(IPrimitive obj) Determines the OSM primitive type of the given object.static OsmPrimitiveTypefromApiTypeName(String typeName) Returns enum value from API type name / JOSM display name, case sensitive.Returns the API type name / JOSM display name.Class<? extends PrimitiveData>Returns the data class.Returns the unique identifier generator.Class<? extends OsmPrimitive>Returns the OSM class for data values, or null.newInstance(long uniqueId, boolean allowNegative) Constructs a new primitive instance (node, way or relation) without version.newVersionedInstance(long id, int version) Constructs a new primitive instance (node, way or relation) with given version.toString()static OsmPrimitiveTypeReturns the enum constant of this class with the specified name.static OsmPrimitiveType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NODE
Node type -
WAY
Way type -
RELATION
Relation type -
CLOSEDWAY
Closed way: only for display, no real type -
MULTIPOLYGON
Multipolygon: only for display, no real type
-
-
Field Details
-
DATA_VALUES
-
apiTypeName
-
osmClass
-
dataClass
-
idGenerator
-
-
Constructor Details
-
OsmPrimitiveType
private OsmPrimitiveType(String apiTypeName, Class<? extends OsmPrimitive> osmClass, Class<? extends PrimitiveData> dataClass, UniqueIdGenerator idGenerator)
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getAPIName
Returns the API type name / JOSM display name.- Returns:
- the API type name / JOSM display name
-
getOsmClass
Returns the OSM class for data values, or null.- Returns:
- the OSM class for data values, or null
-
getDataClass
Returns the data class.- Returns:
- the data class
-
fromApiTypeName
Returns enum value from API type name / JOSM display name, case sensitive.- Parameters:
typeName- API type name / JOSM display name, case sensitive- Returns:
- matching enum value
- Throws:
IllegalArgumentException- if the type name does not match any valid type- See Also:
-
from
Determines the OSM primitive type of the given object.- Parameters:
obj- the OSM object to inspect- Returns:
- the OSM primitive type of
obj - Throws:
IllegalArgumentException- ifobjis null or of unknown type
-
from
Returns enum value from API type name / JOSM display name, case insensitive.- Parameters:
value- API type name / JOSM display name, case insensitive- Returns:
- matching enum value or null
- See Also:
-
dataValues
Returns the values matching real OSM API data types (node, way, relation).- Returns:
- the values matching real OSM API data types (node, way, relation)
-
newInstance
Constructs a new primitive instance (node, way or relation) without version.- Parameters:
uniqueId- the unique idallowNegative-trueto allow negative id- Returns:
- a new primitive instance (node, way or relation)
- Throws:
IllegalArgumentException- if uniqueId < 0 and allowNegative is false
-
newVersionedInstance
Constructs a new primitive instance (node, way or relation) with given version.- Parameters:
id- The id. Must be >= 0version- The version- Returns:
- a new primitive instance (node, way or relation) with given version
- Throws:
IllegalArgumentException- if id < 0- Since:
- 12018
-
getIdGenerator
Returns the unique identifier generator.- Returns:
- the unique identifier generator
- Since:
- 15820
-
toString
- Overrides:
toStringin classEnum<OsmPrimitiveType>
-