public class Fare extends Object
Fare is a set of fares for different classes of users.
Modifier and Type | Class and Description |
---|---|
static class |
Fare.FareType |
Modifier and Type | Field and Description |
---|---|
HashMap<Fare.FareType,List<FareComponent>> |
details
A mapping from
Fare.FareType to a list of FareComponent . |
HashMap<Fare.FareType,Money> |
fare
A mapping from
Fare.FareType to Money . |
Modifier and Type | Method and Description |
---|---|
void |
addCost(int surcharge) |
void |
addFare(Fare.FareType fareType,
Money money) |
void |
addFare(Fare.FareType fareType,
WrappedCurrency currency,
int cents) |
void |
addFareDetails(Fare.FareType fareType,
List<FareComponent> newDetails) |
List<FareComponent> |
getDetails(Fare.FareType type) |
Money |
getFare(Fare.FareType type) |
String |
toString() |
public HashMap<Fare.FareType,Money> fare
Fare.FareType
to Money
.public HashMap<Fare.FareType,List<FareComponent>> details
Fare.FareType
to a list of FareComponent
.public Fare()
public Fare(Fare aFare)
public void addFare(Fare.FareType fareType, WrappedCurrency currency, int cents)
public void addFare(Fare.FareType fareType, Money money)
public void addFareDetails(Fare.FareType fareType, List<FareComponent> newDetails)
public Money getFare(Fare.FareType type)
public List<FareComponent> getDetails(Fare.FareType type)
public void addCost(int surcharge)
Copyright © 2018. All rights reserved.