com.azalient.api.b.network
Interface IRestrictable

All Known Subinterfaces:
IChannel, ICourse, ICrossing, ILane, IPhaseCrossing, ITurn, IWalkway, IWay

public interface IRestrictable

A common base interface for parts of a route that may be restricted, such as lanes, turns, walkways and courses


Method Summary
 boolean allows(IBehaviour b, boolean atEnd)
          Returns true if this route segment allows the passage of the given behaviour.
 boolean allows(IType type, boolean atEnd)
          Returns true if this route segment allows the passage of the given type.
 boolean closed()
          True if closed.
 void closed(boolean closed)
          Set this route segment to be closed.
 IRestriction[] multipleRestrictions()
          Return all restrictions that may apply to this way
 void multipleRestrictions(IRestriction[] mra)
          Set an array of restrictions on this segment.
 String name()
          The name of this restrictable object
 IRestriction restriction()
          Returns any current restriction for this way, or null for no restriction.
 void restriction(IRestriction restriction)
          Set the restriction on this route segment.
 int restrictionIndex()
          Return 0 for no restriction, 1..N for a restriction or -1 for closed.
 

Method Detail

name

String name()
The name of this restrictable object


closed

boolean closed()
True if closed. It is possible to be closed AND have a restriction


restriction

IRestriction restriction()
Returns any current restriction for this way, or null for no restriction.


restrictionIndex

int restrictionIndex()
Return 0 for no restriction, 1..N for a restriction or -1 for closed. If both closed and restriction, returns -1


multipleRestrictions

IRestriction[] multipleRestrictions()
Return all restrictions that may apply to this way


allows

boolean allows(IType type,
               boolean atEnd)
Returns true if this route segment allows the passage of the given type. If atEnd is true, then the agent making the enquiry is near enough to the end that it would be able to use the restriction pocket, if one exists.


allows

boolean allows(IBehaviour b,
               boolean atEnd)
Returns true if this route segment allows the passage of the given behaviour. If atEnd is true, then the agent making the enquiry is near enough to the end that it would be able to use the restriction pocket, if one exists.


closed

void closed(boolean closed)
Set this route segment to be closed. It is possible to be closed AND have a restriction


restriction

void restriction(IRestriction restriction)
Set the restriction on this route segment.


multipleRestrictions

void multipleRestrictions(IRestriction[] mra)
Set an array of restrictions on this segment. Only one may be active at any one time, but they may be controlled by term. For example a lane may be a transit lane in the morning, parking at another time of day and general traffic the rest of the time.