All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class busrider.Junction

java.lang.Object
   |
   +----busrider.Indexed
           |
           +----busrider.Item
                   |
                   +----busrider.Junction

public class Junction
extends Item
This immutable class represents a junction. A junction has a name, and a collection of segments connecting to it. It may also have a popularity (the likelihood of being selected); if so it is a terminus.
For graphical purposes, it also has x- and y- coordinates.


Constructor Index

 o Junction(MutableJunction, BoardBuilder)
constructs an object like the given MutableJunction.

Method Index

 o equals(Object)
compares for name-equality.
 o getPopularity()
returns the junction's popularity.
 o getPX()
returns the junction's X-coordinate.
 o getPY()
returns the junction's Y-coordinate.
 o getSegment(int)
returns the idx'th segment connecting to the junction.
 o getSegmentQuan()
returns the number of segments connecting to the junction.
 o isTerminus()
indicates whether the junction is a terminus.

Constructors

 o Junction
 public Junction(MutableJunction mj,
                 BoardBuilder bb)
constructs an object like the given MutableJunction.

Methods

 o equals
 public boolean equals(Object ob)
compares for name-equality.

Overrides:
equals in class Item
 o isTerminus
 public boolean isTerminus()
indicates whether the junction is a terminus.

 o getSegmentQuan
 public int getSegmentQuan()
returns the number of segments connecting to the junction.

 o getSegment
 public Segment getSegment(int idx)
returns the idx'th segment connecting to the junction.

 o getPopularity
 public int getPopularity()
returns the junction's popularity. The Board has the total popularity.

 o getPX
 public int getPX()
returns the junction's X-coordinate.

 o getPY
 public int getPY()
returns the junction's Y-coordinate.


All Packages  Class Hierarchy  This Package  Previous  Next  Index