All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class busrider.Board

java.lang.Object
   |
   +----busrider.Board

public class Board
extends Object
This immutable class represents the playing board. It has a collection of junctions, a collection of routes, a collection of route-segments, the total terminus-popularity, and payoffs for each pair of termini.


Constructor Index

 o Board()
constructs an empty board.

Method Index

 o getJunction(int)
returns the idx'th junction.
 o getJunctionQuan()
returns the number of junctions.
 o getPayoff(Junction, Junction)
returns the payoff for a trip from one terminus to another.
 o getRoute(int)
returns the idx'th route.
 o getRouteQuan()
returns the number of routes.
 o getSegment(int)
returns the idx'th segment.
 o getSegmentQuan()
returns the number of segments.
 o getTotalPopularity()
returns the total popularity of all termini.
 o loadBoard(String)
produces a board from a file.

Constructors

 o Board
 public Board()
constructs an empty board.

Methods

 o getJunctionQuan
 public int getJunctionQuan()
returns the number of junctions.

 o getRouteQuan
 public int getRouteQuan()
returns the number of routes.

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

 o getJunction
 public Junction getJunction(int idx)
returns the idx'th junction.

 o getRoute
 public Route getRoute(int idx)
returns the idx'th route.

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

 o getTotalPopularity
 public int getTotalPopularity()
returns the total popularity of all termini.

 o getPayoff
 public int getPayoff(Junction j1,
                      Junction j2)
returns the payoff for a trip from one terminus to another.

 o loadBoard
 public static Board loadBoard(String filename)
produces a board from a file.


All Packages  Class Hierarchy  This Package  Previous  Next  Index