MCPcopy Create free account
hub / github.com/PCGen/pcgen / evaluateCost

Method evaluateCost

code/src/java/pcgen/core/Equipment.java:4236–4253  ·  view source on GitHub ↗
(final PJEP myParser, final String costExpr)

Source from the content-addressed store, hash-verified

4234 }
4235
4236 private BigDecimal evaluateCost(final PJEP myParser, final String costExpr)
4237 {
4238 myParser.parseExpression(costExpr);
4239
4240 if (!myParser.hasError())
4241 {
4242 final Object result = myParser.getValueAsObject();
4243
4244 if (result != null)
4245 {
4246 return new BigDecimal(result.toString());
4247 }
4248 }
4249
4250 Logging.errorPrint("Bad equipment cost expression: " + costExpr);
4251
4252 return BigDecimal.ZERO;
4253 }
4254
4255 private boolean ignoresCostDouble()
4256 {

Callers 1

getCostFromPlusesMethod · 0.95

Calls 3

errorPrintMethod · 0.95
parseExpressionMethod · 0.80
toStringMethod · 0.65

Tested by

no test coverage detected