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
  - 
	Board()
  
 -  constructs an empty board.
 
  Method Index
  - 
	getJunction(int)
  
 -  returns the 
idx'th junction.
   - 
	getJunctionQuan()
  
 -  returns the number of junctions.
  
 - 
	getPayoff(Junction, Junction)
  
 -  returns the payoff for a trip from one terminus to another.
  
 - 
	getRoute(int)
  
 -  returns the 
idx'th route.
   - 
	getRouteQuan()
  
 -  returns the number of routes.
  
 - 
	getSegment(int)
  
 -  returns the 
idx'th segment.
   - 
	getSegmentQuan()
  
 -  returns the number of segments.
  
 - 
	getTotalPopularity()
  
 -  returns the total popularity of all termini.
  
 - 
	loadBoard(String)
  
 -  produces a board from a file.
 
  Constructors
Board
 public Board()
  -  constructs an empty board.
 
  Methods
getJunctionQuan
 public int getJunctionQuan()
  -  returns the number of junctions.
 
getRouteQuan
 public int getRouteQuan()
  -  returns the number of routes.
 
getSegmentQuan
 public int getSegmentQuan()
  -  returns the number of segments.
 
getJunction
 public Junction getJunction(int idx)
  -  returns the 
idx'th junction.
 
getRoute
 public Route getRoute(int idx)
  -  returns the 
idx'th route.
 
getSegment
 public Segment getSegment(int idx)
  -  returns the 
idx'th segment.
 
getTotalPopularity
 public int getTotalPopularity()
  -  returns the total popularity of all termini.
 
getPayoff
 public int getPayoff(Junction j1,
                      Junction j2)
  -  returns the payoff for a trip from one terminus to another.
 
loadBoard
 public static Board loadBoard(String filename)
  -  produces a board from a file.
 
All Packages  Class Hierarchy  This Package  Previous  Next  Index