org.ka2ddo.yaac.osm
Class GenericTaggedNode<T extends GenericTaggedNode>

java.lang.Object
  extended by org.ka2ddo.yaac.osm.GenericTaggedNode<T>
Direct Known Subclasses:
ChangeSet, Node, Relation, Way

public abstract class GenericTaggedNode<T extends GenericTaggedNode>
extends java.lang.Object

Abstract class describing common attributes of a OSM dataset object.


Field Summary
 java.lang.Object[] decodedtagArray
          An array containing tags of rendering-useful values (indexed by key ordinal) extracted from the XML OSM representation.
static short FIXME
          Flag bit indicating Node or Way is defective and needs updates.
 short flags
          Bitmask of flags representing important boolean conditions about this dataset object.
static short HAS_ID
          Flag bit indicating Node or Way has an ID number (should always be set).
static short HAS_ID64
          Flag bit indicating Node has a 64-bit-long ID number.
static short HAS_INTERNET_ACCESS
          Flag bit indicating the Node or Way provides public Internet service.
static short HAS_TOLL
          Flag bit indicating toll is charged to travel the Way.
static short IS_AREA
          Flag bit indicating Way is an enclosed area,
static short IS_BRIDGE
          Flag bit indicating Way is a bridge above other features.
static short IS_BUILDING
          Flag bit indicating Way is a building, not open area.
static short IS_DISUSED
          Flag bit indicating associated amenity is no longer in use or is abandoned.
static short IS_INFERRED_AREA
          Flag bit indicating Way was assumed to be an area based on its other properties.
static short IS_ISLAND
          Flag bit indicating Way is the coastline of an island.
static short IS_LIT
          Flag bit indicating Node or Way has artificial illumination.
static short IS_ONEWAY
          Flag bit indicating Way only permits traffic in one direction.
static short IS_ONEWAY_BACKWARDS
          Flag bit indicating Way only permits traffic in one direction, but the vertices are in reverse order.
static short IS_TUNNEL
          Flag bit indicating Way is a tunnel underneath other features.
static short IS_WATER
          Flag bit indicating Way is a water object.
static short RENDERABLE_FLAGS
          Bitmask of flags where if any of these bits are set, the Way or Node is renderable, even without a waytype.
 
Constructor Summary
GenericTaggedNode()
           
 
Method Summary
 java.lang.String decodedTagArrayToString()
          Stringify the tags attached to this GenericTaggedNode.
abstract  T dup()
          Create a deep copy of this Node.
 void ensureElementHasTagArray()
          Ensure that this GenericTaggedNode has a decodedtagArray element in it.
 int getDecodedTagCount()
          Report the number of decoded tag values for this GenericTaggedNode.
 boolean hasDecodedTags()
          Report whether this GenericTaggedNode has decoded tag values.
 void putTag(OSMLayerEnum key, java.lang.Object value)
          Store a key-value pair in the tag map.
protected  void readTags(java.io.DataInput dis)
          Helper method for reading tags and flags in a common format from an input stream.
abstract  void writeGPX(java.io.PrintStream ps)
          Write this GenericTaggedNode to the specified stream as the XML tags one element in GPX schema format.
protected abstract  void writeId(java.io.DataOutput dos)
          Handle writing the ID field to the binary data stream (handles larger ID ranges in varying subclasses).
protected  void writeTags(java.io.DataOutput dos)
          Helper method for writing tags and flags in a common format to an output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

decodedtagArray

public java.lang.Object[] decodedtagArray
An array containing tags of rendering-useful values (indexed by key ordinal) extracted from the XML OSM representation. May be null if no relevant tags existed for the OSM dataset object.


flags

public short flags
Bitmask of flags representing important boolean conditions about this dataset object.

See Also:
HAS_ID, HAS_ID64, HAS_INTERNET_ACCESS, HAS_TOLL, IS_AREA, IS_BRIDGE, IS_BUILDING, IS_DISUSED, IS_INFERRED_AREA, IS_ISLAND, IS_LIT, IS_ONEWAY, IS_ONEWAY_BACKWARDS, IS_TUNNEL, IS_WATER, FIXME

IS_AREA

public static final short IS_AREA
Flag bit indicating Way is an enclosed area,

See Also:
Constant Field Values

IS_BUILDING

public static final short IS_BUILDING
Flag bit indicating Way is a building, not open area.

See Also:
Constant Field Values

IS_WATER

public static final short IS_WATER
Flag bit indicating Way is a water object.

See Also:
Constant Field Values

HAS_TOLL

public static final short HAS_TOLL
Flag bit indicating toll is charged to travel the Way.

See Also:
Constant Field Values

IS_BRIDGE

public static final short IS_BRIDGE
Flag bit indicating Way is a bridge above other features.

See Also:
Constant Field Values

IS_TUNNEL

public static final short IS_TUNNEL
Flag bit indicating Way is a tunnel underneath other features.

See Also:
Constant Field Values

IS_ONEWAY

public static final short IS_ONEWAY
Flag bit indicating Way only permits traffic in one direction.

See Also:
Constant Field Values

IS_ONEWAY_BACKWARDS

public static final short IS_ONEWAY_BACKWARDS
Flag bit indicating Way only permits traffic in one direction, but the vertices are in reverse order.

See Also:
Constant Field Values

HAS_INTERNET_ACCESS

public static final short HAS_INTERNET_ACCESS
Flag bit indicating the Node or Way provides public Internet service.

See Also:
Constant Field Values

IS_ISLAND

public static final short IS_ISLAND
Flag bit indicating Way is the coastline of an island.

See Also:
Constant Field Values

IS_DISUSED

public static final short IS_DISUSED
Flag bit indicating associated amenity is no longer in use or is abandoned.

See Also:
Constant Field Values

IS_LIT

public static final short IS_LIT
Flag bit indicating Node or Way has artificial illumination.

See Also:
Constant Field Values

HAS_ID

public static final short HAS_ID
Flag bit indicating Node or Way has an ID number (should always be set).

See Also:
Constant Field Values

IS_INFERRED_AREA

public static final short IS_INFERRED_AREA
Flag bit indicating Way was assumed to be an area based on its other properties.

See Also:
Constant Field Values

HAS_ID64

public static final short HAS_ID64
Flag bit indicating Node has a 64-bit-long ID number.

See Also:
Constant Field Values

FIXME

public static final short FIXME
Flag bit indicating Node or Way is defective and needs updates.

See Also:
Constant Field Values

RENDERABLE_FLAGS

public static final short RENDERABLE_FLAGS
Bitmask of flags where if any of these bits are set, the Way or Node is renderable, even without a waytype.

See Also:
Constant Field Values
Constructor Detail

GenericTaggedNode

public GenericTaggedNode()
Method Detail

writeId

protected abstract void writeId(java.io.DataOutput dos)
                         throws java.io.IOException
Handle writing the ID field to the binary data stream (handles larger ID ranges in varying subclasses).

Parameters:
dos - DataOutput to use to append the binary ID value
Throws:
java.io.IOException - if write fails for any reason

writeTags

protected final void writeTags(java.io.DataOutput dos)
                        throws java.io.IOException
Helper method for writing tags and flags in a common format to an output stream.

Parameters:
dos - DataOutput implementing object to write the tags and flags to
Throws:
java.io.IOException - if the write failed for any reason

readTags

protected final void readTags(java.io.DataInput dis)
                       throws java.io.IOException
Helper method for reading tags and flags in a common format from an input stream.

Parameters:
dis - DataInput implementing object to read the tags and flags from
Throws:
java.io.IOException - if the read failed for any reason

putTag

public void putTag(OSMLayerEnum key,
                   java.lang.Object value)
Store a key-value pair in the tag map.

Parameters:
key - OSMLayerEnum identifying the tag attribute
value - value of the attribute

getDecodedTagCount

public final int getDecodedTagCount()
Report the number of decoded tag values for this GenericTaggedNode.

Returns:
number of non-null entries in the decodedtagArray

hasDecodedTags

public final boolean hasDecodedTags()
Report whether this GenericTaggedNode has decoded tag values.

Returns:
boolean true if there are non-null values in the decodedTagArray

decodedTagArrayToString

public java.lang.String decodedTagArrayToString()
Stringify the tags attached to this GenericTaggedNode.

Returns:
String formatting of decodedtagArray

ensureElementHasTagArray

public void ensureElementHasTagArray()
Ensure that this GenericTaggedNode has a decodedtagArray element in it.


dup

public abstract T dup()
Create a deep copy of this Node. Similar to the Object method clone(), but without the exceptions and casting.

Returns:
copy of this GenericTaggedNode

writeGPX

public abstract void writeGPX(java.io.PrintStream ps)
Write this GenericTaggedNode to the specified stream as the XML tags one element in GPX schema format.

Parameters:
ps - PrintStream to write to