public class WithAttributes extends Object implements IWithAttributes, GpxConstants
Modifier and Type | Field and Description |
---|---|
Map<String,Object> |
attr
The "attr" hash is used to store the XML payload (not only XML attributes!)
|
FIX_VALUES, GPX_CMT, GPX_DESC, GPX_NAME, GPX_SRC, JOSM_EXTENSIONS_NAMESPACE_URI, META_AUTHOR_EMAIL, META_AUTHOR_LINK, META_AUTHOR_NAME, META_BOUNDS, META_COPYRIGHT_AUTHOR, META_COPYRIGHT_LICENSE, META_COPYRIGHT_YEAR, META_DESC, META_EXTENSIONS, META_KEYWORDS, META_LINKS, META_NAME, META_PREFIX, META_TIME, PT_AGEOFDGPSDATA, PT_DGPSID, PT_ELE, PT_FIX, PT_GEOIDHEIGHT, PT_HDOP, PT_MAGVAR, PT_PDOP, PT_SAT, PT_SYM, PT_TIME, PT_TYPE, PT_VDOP, RTE_TRK_KEYS, WPT_KEYS
Constructor and Description |
---|
WithAttributes() |
Modifier and Type | Method and Description |
---|---|
void |
addExtension(String key,
String value)
Add a key / value pair that is not part of the GPX schema as an extension.
|
Object |
get(String key)
Returns the Object value to which the specified key is mapped,
or
null if this map contains no mapping for the key. |
<T> Collection<T> |
getCollection(String key)
Returns the Collection value to which the specified key is mapped,
or
null if this map contains no Collection mapping for the key. |
String |
getString(String key)
Returns the String value to which the specified key is mapped,
or
null if this map contains no String mapping for the key. |
void |
put(String key,
Object value)
Put a key / value pair as a new attribute.
|
public WithAttributes()
public Object get(String key)
null
if this map contains no mapping for the key.get
in interface IWithAttributes
key
- the key whose associated value is to be returnedpublic String getString(String key)
null
if this map contains no String mapping for the key.getString
in interface IWithAttributes
key
- the key whose associated value is to be returnednull
if this map contains no String mapping for the keypublic <T> Collection<T> getCollection(String key)
null
if this map contains no Collection mapping for the key.getCollection
in interface IWithAttributes
key
- the key whose associated value is to be returnednull
if this map contains no Collection mapping for the keypublic void put(String key, Object value)
put
in interface IWithAttributes
key
- the keyvalue
- the valuepublic void addExtension(String key, String value)
addExtension
in interface IWithAttributes
key
- the keyvalue
- the value