`public class VatCalculator {
Product product=new Product();
Airport airport=new Airport();
VATRates vatrates =new VATRates();
TaxTable taxtable= new TaxTable();
//private String vatTable;
// public VatCalculator(TaxTable taxTable) {
// `Z`super(taxTable);
// this.vatTable= generateVatTable();
// }
我需要在我的VatCalculator类中使用taxtable作为输入。我创建了一个对象,但不知道如何从TaxTable获取数据。我怎样才能做到这一点?
I am trying to create a Vat Calculator which calculates based on the taxtable.[vat class][1]
[data][2]
[1]: http://i.stack.imgur.com/r5MFs.png
[2]: http://i.stack.imgur.com/Ajj42.png
有一个名为TaxTable的类,用于保存JSON文件(DB)中的数据。 图片:
public class TaxTable implements Serializable {
private static final long serialVersionUID = 1L;
private String taxGroup;
private double onboardSalePct;
private double onboardServicePct;
private double preorderSalePct;
private double preorderServicePct;
@JsonCreator
public TaxTable(@JsonProperty("tax_group") String taxGroup,
@JsonProperty("onboard_sale_pct") double onboardSalePct,
@JsonProperty("onboard_service_pct") double onboardServicePct,
@JsonProperty("preorder_sale_pct") double preorderSalePct,
@JsonProperty("preorder_service_pct") double preorderServicePct) {
this.taxGroup = taxGroup;
this.onboardSalePct = onboardSalePct;
this.onboardServicePct = onboardServicePct;
this.preorderSalePct = preorderSalePct;
this.preorderServicePct = preorderServicePct;
}
/**
* @return the taxGroup
*/
public String getTaxGroup() {
return taxGroup;
}
/**
* @param taxGroup
* the taxGroup to set
*/
public void setTaxGroup(String taxGroup) {
this.taxGroup = taxGroup;
}