uk.me.parabola.imgfmt.app.net
Class TableB

java.lang.Object
  extended by uk.me.parabola.imgfmt.app.net.TableB

public class TableB
extends java.lang.Object

Table B contains offsets in NOD1 of neighbouring nodes outside the containing RouteCenter.


Constructor Summary
TableB()
           
 
Method Summary
 void addNode(RouteNode node)
          Add a node (in another RouteCenter) to this Table and return its index.
 byte getIndex(RouteNode node)
          Retrieve a nodes index.
 byte getNumberOfItems()
          Retrieve the size of the table as byte.
 int size()
          Retrieve the size of the Table as an int.
 void write(ImgFileWriter writer)
          Reserve space, since node offsets in other RoutingCenters need not be known yet.
 void writePost(ImgFileWriter writer)
          Fill in node offsets.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableB

public TableB()
Method Detail

size

public int size()
Retrieve the size of the Table as an int. While Table B is limited in size (0x100 entries), we temporarily build larger tables while subdividing the network.


getNumberOfItems

public byte getNumberOfItems()
Retrieve the size of the table as byte. This value is what should be written to the table header. When this is read, the table is assumed to be fit for writing, so at this point we check it isn't too large.


addNode

public void addNode(RouteNode node)
Add a node (in another RouteCenter) to this Table and return its index. This index may overflow while it isn't certain that the table fulfills the size constraint.


getIndex

public byte getIndex(RouteNode node)
Retrieve a nodes index. Checked for correct bounds.


write

public void write(ImgFileWriter writer)
Reserve space, since node offsets in other RoutingCenters need not be known yet. See writePost.


writePost

public void writePost(ImgFileWriter writer)
Fill in node offsets.