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

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

public class RouteRestriction
extends java.lang.Object

A restriction in the routing graph. There may eventually be several types of these at which point we might consider splitting them into several classes. For the moment, just simple from-to-via restrictions. A from-to-via restriction says you can't go along arc "to" if you came to node to.getSource() == from.getSource() via the inverse arc of "from". We're using the inverse of "from" since that has the information we need for writing the Table C entry.

Author:
Robert Vollmert

Field Summary
static byte EXCEPT_BICYCLE
           
static byte EXCEPT_BUS
           
static byte EXCEPT_CAR
           
static byte EXCEPT_DELIVERY
           
static byte EXCEPT_TAXI
           
static byte EXCEPT_TRUCK
           
 
Constructor Summary
RouteRestriction(RouteArc from, RouteArc to, byte exceptMask)
          Create a route restriction.
 
Method Summary
 int getOffsetC()
           
 int getSize()
          Size in bytes of the Table C entry.
 void setLast()
           
 void setOffsetC(int offsetC)
           
 void setOffsetSize(byte size)
           
 void write(ImgFileWriter writer, int tableOffset)
          Writes a Table C entry.
 void writeOffset(ImgFileWriter writer)
          Write this restriction's offset within Table C into a node record.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXCEPT_CAR

public static final byte EXCEPT_CAR
See Also:
Constant Field Values

EXCEPT_BUS

public static final byte EXCEPT_BUS
See Also:
Constant Field Values

EXCEPT_TAXI

public static final byte EXCEPT_TAXI
See Also:
Constant Field Values

EXCEPT_DELIVERY

public static final byte EXCEPT_DELIVERY
See Also:
Constant Field Values

EXCEPT_BICYCLE

public static final byte EXCEPT_BICYCLE
See Also:
Constant Field Values

EXCEPT_TRUCK

public static final byte EXCEPT_TRUCK
See Also:
Constant Field Values
Constructor Detail

RouteRestriction

public RouteRestriction(RouteArc from,
                        RouteArc to,
                        byte exceptMask)
Create a route restriction.

Parameters:
from - The inverse arc of "from" arc.
to - The "to" arc.
Method Detail

write

public void write(ImgFileWriter writer,
                  int tableOffset)
Writes a Table C entry.

Parameters:
writer - The writer.
tableOffset - The offset in NOD 1 of the tables area.

writeOffset

public void writeOffset(ImgFileWriter writer)
Write this restriction's offset within Table C into a node record.


getSize

public int getSize()
Size in bytes of the Table C entry.


setOffsetC

public void setOffsetC(int offsetC)

getOffsetC

public int getOffsetC()

setOffsetSize

public void setOffsetSize(byte size)

setLast

public void setLast()