public class Node extends GenericTaggedNode<Node> implements java.lang.Comparable<Node>, java.io.Serializable
GenericTaggedNode.ExtendedGTNAttr
Modifier and Type | Field and Description |
---|---|
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.
|
decodedtagArray, extraAmenities, FIXME, FIXME_OBJ, flags, flags2, FLAGS2_BOGUS, FLAGS2_BOGUS_OBJ, FLAGS2_FEE, FLAGS2_FEE_OBJ, FLAGS2_FLOOD_PRONE, FLAGS2_FLOOD_PRONE_OBJ, FLAGS2_HAS_POSTALADDR, FLAGS2_INTERMITTENT, FLAGS2_INTERMITTENT_OBJ, FLAGS2_IS_LIT, FLAGS2_IS_LIT_OBJ, FLAGS2_UNDERGROUND, FLAGS2_WHEELCHAIR_ACCESSIBLE, FLAGS2_WHEELCHAIR_ACCESSIBLE_OBJ, HAS_COLOR, HAS_ID, HAS_ID64, HAS_INTERNET_ACCESS, HAS_INTERNET_ACCESS_OBJ, HAS_TOLL, HAS_TOLL_OBJ, IS_AREA, IS_AREA_OBJ, IS_BRIDGE, IS_BRIDGE_OBJ, IS_BUILDING, IS_BUILDING_OBJ, IS_DISUSED, IS_DISUSED_OBJ, IS_HOLE, IS_INCOMPLETE, IS_ISLAND, IS_ISLAND_OBJ, IS_ONEWAY, IS_ONEWAY_BACKWARDS, IS_ONEWAY_BACKWARDS_OBJ, IS_ONEWAY_OBJ, IS_TUNNEL, IS_TUNNEL_OBJ, IS_WATER, MARINE, RENDERABLE_FLAGS, segmentNum
Constructor and Description |
---|
Node() |
Modifier and Type | Method and Description |
---|---|
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.
|
java.lang.Number |
getId()
Return the ID of this OSM record as a sub-class of Number.
|
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.
|
void |
reread(NonshareableBufferedDataInputStream 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.
|
addAmenityType, compareGTNAttributes, decodedTagArrayToString, ensureElementHasTagArray, hasDecodedTags, hasThisAmenity, putTag, readTags, readTags, removeRedundantAmenityTypes, replaceAmenityType, writeTags
public long id
public int latitude
public int longitude
public void write(java.io.DataOutput os) throws java.io.IOException
os
- DataOutput object to write tojava.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 valuejava.io.IOException
- if ID write failspublic java.lang.Number getId()
getId
in class GenericTaggedNode<Node>
public static Node read(java.io.DataInput is) throws java.io.IOException
is
- DataInput to read the Node fromjava.io.IOException
- if read failspublic void reread(java.io.DataInput is) throws java.io.IOException
is
- DataInput to read the next Node fromjava.io.IOException
- if read failspublic void reread(NonshareableBufferedDataInputStream is) throws java.io.IOException
is
- DataInput to read the next Node fromjava.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 Eastpublic 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 nulljava.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 outputjava.io.IOException
- if node file cannot be read for any reason