|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ka2ddo.yaac.osm.GenericTaggedNode<Node>
org.ka2ddo.yaac.osm.Node
public class Node
This class represents a Node element of an OSM file.
Field Summary | |
---|---|
long |
id
OpenStreetMap assigned ID number for this Node. |
int |
latitude
Latitude in millionths of degrees North. |
int |
longitude
Longitude in millionths of degrees East. |
Fields inherited from class org.ka2ddo.yaac.osm.GenericTaggedNode |
---|
decodedtagArray, FIXME, flags, 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, RENDERABLE_FLAGS |
Constructor Summary | |
---|---|
Node()
|
Method Summary | |
---|---|
int |
compareTo(Node o2)
Compares this Node with the specified Node for order. |
Node |
dup()
Create a deep copy of this Node. |
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one. |
int |
hashCode()
Returns a hash code value for the object. |
boolean |
intersects(int lLat,
int hLat,
int lLon,
int hLon)
Test if this Node intersects the specified axis-aligned bounding box. |
static void |
main(java.lang.String[] args)
For unit testing of Node class only. |
static Node |
read(java.io.DataInput is)
Read the next Node from the input stream. |
void |
reread(java.io.DataInput is)
Replace the contents of this Node object with the next Node in the input stream. |
java.lang.String |
toString()
Generate a String describing this Node. |
void |
write(java.io.DataOutput os)
Writes the Node to the specified DataOutput implementing file access object in the YAAC compressed binary map data format. |
void |
writeGPX(java.io.PrintStream ps)
Write this Node to the specified stream as the XML tags one element in GPX schema format. |
protected void |
writeId(java.io.DataOutput dos)
Append the ID number of this Node to the written binary save stream. |
Methods inherited from class org.ka2ddo.yaac.osm.GenericTaggedNode |
---|
decodedTagArrayToString, ensureElementHasTagArray, getDecodedTagCount, hasDecodedTags, putTag, readTags, writeTags |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public long id
public int latitude
public int longitude
Constructor Detail |
---|
public Node()
Method Detail |
---|
public void write(java.io.DataOutput os) throws java.io.IOException
os
- DataOutput object to write to
java.io.IOException
- if write failed for any reasonprotected void writeId(java.io.DataOutput dos) throws java.io.IOException
writeId
in class GenericTaggedNode<Node>
dos
- DataOutput to use to append the binary ID value
java.io.IOException
- if ID write failspublic static Node read(java.io.DataInput is) throws java.io.IOException
is
- DataInput to read the Node from
java.io.IOException
- if read failspublic void reread(java.io.DataInput is) throws java.io.IOException
is
- DataInput to read the next Node from
java.io.IOException
- if read failspublic boolean intersects(int lLat, int hLat, int lLon, int hLon)
lLat
- minimum latitude in millionths of degrees NorthhLat
- maximum latitude in millionths of degrees NorthlLon
- minimum longitude in millionths of degrees EasthLon
- maximum longitude in millionths of degrees East
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(Node o2)
compareTo
in interface java.lang.Comparable<Node>
o2
- the Node to be compared.
java.lang.NullPointerException
- if the specified object is null
java.lang.ClassCastException
- if the specified object's type prevents it
from being compared to this object.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the reference object with which to compare.
true
if this object is the same as the obj
argument; false
otherwise.hashCode()
public int hashCode()
hashCode
in class java.lang.Object
equals(Object)
public Node dup()
dup
in class GenericTaggedNode<Node>
public void writeGPX(java.io.PrintStream ps)
writeGPX
in class GenericTaggedNode<Node>
ps
- PrintStream to write topublic static void main(java.lang.String[] args) throws java.io.IOException
args
- String array of parameters. [0] is path of node file to read, [1] is optional -quiet flag to suppress most printed output
java.io.IOException
- if node file cannot be read for any reason
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |