|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.cuny.cat.server.ShoutValidator
public class ShoutValidator
A class used by the game server to check the validity of a shout.
Parameters
| base.maxprice double (1000 by default) |
(the upper bound of the price of a shout) |
| base.minprice double (0 by default) |
(the lower bound of the price of a shout) |
Default Base
| shout |
| Field Summary | |
|---|---|
protected double |
maxPrice
the maximal price a shout may offer |
protected double |
minPrice
the minimal price a shout may offer |
static java.lang.String |
P_DEF_BASE
|
static java.lang.String |
P_MAXPRICE
|
static java.lang.String |
P_MINPRICE
|
| Constructor Summary | |
|---|---|
ShoutValidator()
|
|
| Method Summary | |
|---|---|
void |
check(boolean isSeller,
double price,
double privateValue)
checks whether a shout from a trader is valid or not. |
void |
check(Shout shout)
checks whether a shout from a trader is valid or not. |
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 |
|---|
public static final java.lang.String P_MAXPRICE
public static final java.lang.String P_MINPRICE
public static final java.lang.String P_DEF_BASE
protected double maxPrice
protected double minPrice
| Constructor Detail |
|---|
public ShoutValidator()
| 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 void check(Shout shout)
throws IllegalShoutException
maxPrice and minPrice.
IllegalShoutException will be thrown if the shout
is found illegal.
shout - the shout to check its validity
IllegalShoutException - thrown when the shout is invalidcheck(boolean, double, double)
public void check(boolean isSeller,
double price,
double privateValue)
throws IllegalShoutException
maxPrice and minPrice.
IllegalShoutException will be thrown if the shout
is found illegal.
isSeller - true if the trader is a seller; false otherwise.price - the price of the shoutprivateValue - the private value of the trader
IllegalShoutException - thrown when the shout is invalidcheck(Shout)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||