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

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

Method Index

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

Constructors

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

Methods

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

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

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

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

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

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

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


All Packages  Class Hierarchy  This Package  Previous  Next  Index