public class ProrataModel
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DAYS
Time unit in days.
|
static int |
HOURS
Time unit in hours.
|
static int |
MINUTES
Time unit in minutes.
|
static int |
ROUND_DOWN
Rounding down mode.
|
static int |
ROUND_NEAREST
Rounding to nearest mode.
|
static int |
ROUND_UP
Rounding up mode.
|
static int |
SECONDS
Time unit in seconds.
|
| Constructor and Description |
|---|
ProrataModel()
Builds an empty ProrataModel.
|
ProrataModel(int unit,
java.math.BigDecimal step,
int mode,
java.math.BigDecimal fraction,
boolean fractionDefined,
boolean splitRefund)
Builds a ProrataModel.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
java.math.BigDecimal |
getFraction()
Gets the fraction.
|
int |
getRoundingMode()
Gets the rounding mode.
|
java.math.BigDecimal |
getRoundingStep()
Gets the rounding step.
|
int |
getTimeUnit()
Gets the time unit.
|
int |
hashCode() |
boolean |
isFractionDefined()
Tests if the fraction is defined.
|
boolean |
isSplitRefund()
Tests if the prorata is a split refund.
|
void |
setFraction(java.math.BigDecimal fraction)
Sets the fraction.
|
void |
setFractionDefined(boolean defined)
Sets the fraction defined.
|
void |
setRoundingMode(int mode)
Sets the rounding mode.
|
void |
setRoundingStep(java.math.BigDecimal step)
Sets the rounding step.
|
void |
setSplitRefund(boolean splitRefund)
Sets the split refund flag.
|
void |
setTimeUnit(int unit)
Sets the time unit.
|
public static final int SECONDS
public static final int MINUTES
public static final int HOURS
public static final int DAYS
public static final int ROUND_UP
public static final int ROUND_DOWN
public static final int ROUND_NEAREST
public ProrataModel()
public ProrataModel(int unit,
java.math.BigDecimal step,
int mode,
java.math.BigDecimal fraction,
boolean fractionDefined,
boolean splitRefund)
unit - the time unit, see setTimeUnit.step - the rounding step.mode - the rounding mode, see setRoundingMode.fraction - the fraction.fractionDefined - set the fraction defined.splitRefund - true if the refund is done on the complete period, false if the refund is partialpublic void setTimeUnit(int unit)
unit - the time unit.public int getTimeUnit()
public void setRoundingStep(java.math.BigDecimal step)
step - the rounding step.public java.math.BigDecimal getRoundingStep()
public void setRoundingMode(int mode)
mode - the rounding mode.public int getRoundingMode()
public void setFraction(java.math.BigDecimal fraction)
fraction - the fraction.public java.math.BigDecimal getFraction()
public void setFractionDefined(boolean defined)
defined - the fraction defined.public boolean isFractionDefined()
public void setSplitRefund(boolean splitRefund)
splitRefund - true if the prorata is a split refund, false otherwisepublic boolean isSplitRefund()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object