|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cuny.cat.server.ChargeValidator
public class ChargeValidator
A class used by the game server to check the validity of the charges from a specialist.
Parameters
base.maxflat double (1000 by default) |
(the upper bound of a flat fee charged by a specialist, including registration fee, information fee, shout fee, and transaction fee.) |
base.minflat double (0 by default) |
(the lower bound of the a flat fee charged by a specialist) |
base.maxfractional double (1 by default) |
(the upper bound of a fractional fee charged by a specialist, including profit fee.) |
base.minfractional double (0 by default) |
(the lower bound of the a fractional fee charged by a specialist) |
base.isbanning boolean ( true by default) |
(whether to ban a specialist on a day when its price list includes invalid values) |
Default Base
charge |
Field Summary | |
---|---|
protected boolean |
isBanning
whether to ban a specialist when its price list includes invalid values |
protected double |
maxFlat
the maximal flat fee a specialist may charge |
protected double |
maxFractional
the maximal fractional fee a specialist may charge |
protected double |
minFlat
the minimal flat fee a specialist may charge |
protected double |
minFractional
the minimal fractional fee a specialist may charge |
static java.lang.String |
P_DEF_BASE
|
static java.lang.String |
P_ISBANNING
|
static java.lang.String |
P_MAXFLAT
|
static java.lang.String |
P_MAXFRACTIONAL
|
static java.lang.String |
P_MINFLAT
|
static java.lang.String |
P_MINFRACTIONAL
|
Constructor Summary | |
---|---|
ChargeValidator()
|
Method Summary | |
---|---|
void |
check(java.lang.String specialistId,
double[] fees)
Throws exceptions when NaN or Infinity values appear in the fee array and the banning policy is in effect. |
double |
getMax(int type)
|
double |
getMaxFlat()
|
double |
getMaxFractional()
|
double |
getMin(int type)
|
double |
getMinFlat()
|
double |
getMinFractional()
|
void |
setup(edu.cuny.config.param.ParameterDatabase parameters,
edu.cuny.config.param.Parameter base)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double maxFlat
protected double minFlat
protected double maxFractional
protected double minFractional
protected boolean isBanning
public static final java.lang.String P_MAXFLAT
public static final java.lang.String P_MINFLAT
public static final java.lang.String P_MAXFRACTIONAL
public static final java.lang.String P_MINFRACTIONAL
public static final java.lang.String P_ISBANNING
public static final java.lang.String P_DEF_BASE
Constructor Detail |
---|
public ChargeValidator()
Method Detail |
---|
public void setup(edu.cuny.config.param.ParameterDatabase parameters, edu.cuny.config.param.Parameter base)
setup
in interface edu.cuny.config.param.Parameterizable
public double getMaxFlat()
public double getMinFlat()
public double getMaxFractional()
public double getMinFractional()
public double getMax(int type)
public double getMin(int type)
public void check(java.lang.String specialistId, double[] fees) throws InvalidChargeException
specialistId
- fees
-
InvalidChargeException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |