private static Currency zeroIndianRupee = new Currency("INR0.00");
private static Currency zeroTaiwanese = new Currency("NTD0.00");
private static Currency zeroCanadian = new Currency("CAD0.00");
Currency getMinimumBidIncrement(Currency currentBid, int bidCount) {
Currency correctedValue = currentBid;
Currency zeroIncrement = zeroDollars;
Currency[][] rightTable;
switch (currentBid.getCurrencyType()) {
// Default to USD, so we don't freak if we're passed a bad
// value. We'll get the wrong answer, but we won't thrash.
default:
correctedValue = zeroDollars;
rightTable = us_incrementTable;
break;
case Currency.US_DOLLAR:
rightTable = us_incrementTable;
break;
case Currency.UK_POUND:
rightTable = uk_incrementTable;
zeroIncrement = zeroPounds;
break;
case Currency.FR_FRANC:
rightTable = fr_incrementTable;
zeroIncrement = zeroFrancs;
break;
case Currency.CH_FRANC:
rightTable = ch_incrementTable;
zeroIncrement = zeroSwissFrancs;
break;
case Currency.EURO:
rightTable = eu_incrementTable;
zeroIncrement = zeroEuros;
break;
case Currency.TW_DOLLAR:
rightTable = tw_incrementTable;
zeroIncrement = zeroTaiwanese;
break;
case Currency.CAN_DOLLAR:
rightTable = ca_incrementTable;
zeroIncrement = zeroCanadian;
break;
case Currency.AU_DOLLAR:
rightTable = au_incrementTable;
zeroIncrement = zeroAustralian;
break;
case Currency.IND_RUPEE:
rightTable = ir_incrementTable;
zeroIncrement = zeroIndianRupee;
break;
}
if (bidCount == 0) return zeroIncrement;
for (Currency[] aRightTable : rightTable) {
Currency endValue = aRightTable[0];
Currency incrementValue = aRightTable[1];
// Sentinel. If we reach the end, return the max.
if (endValue == null || endValue.isNull()) return incrementValue;
try {