/* * [SalesTaxItem.java] * * Summary: Object to contain the triple : county, city, percent sales tax factoid. Does not include state. * * Copyright: (c) 2005-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 2.8 2008-06-01 add AZ support for counties. */ package com.mindprod.americantax; import java.util.Comparator; /** * Object to contain the triple : county, city, percent sales tax factoid. Does not include state. *
* Only used to prepare tables, not used at run time. * * Cannot implement Comparable because of generics conflicts. * * @author Roedy Green, Canadian Mind Products * @version 2.8 2008-06-01 add AZ support for counties. * @see DistrictItem * @see StateItem * @since 2005 */ class SalesTaxItem { private final String county; private final double percent; private String city; /** * constructor * * @param county county name * @param city city, region of county * @param percent tax rate percent. including state tax?? including county tax?? */ public SalesTaxItem( final String county, final String city, final double percent ) { assert county != null : "null county"; this.county = county.trim().intern(); if ( city == null ) { this.city = ""; } else { this.city = city.trim().intern(); } this.percent = percent; } public void clearCity() { this.city = ""; } public String getCity() { return city; } public String getCounty() { return county; } public double getPercent() { return percent; } /** * sort SalesTaxItems alphabetically */ static final class Alphabetically implements Comparator