org.hd.d.pg2k.ai.scorer
Interface ScorerParam

All Known Implementing Classes:
ScorerParamEnum, ScorerParamInteger

public interface ScorerParam


Method Summary
 ScorerParam extract(ScorerParam p)
          Use the supplied parameter if possible (correct name/type/bounds), else return the default; never null.
 java.lang.String getName()
          Get the parameter name; never null or empty.
 ScorerParam parse(java.lang.String v)
          Parse the String representation of a parameter returning a value of the same type; never null.
 ScorerParam perturb()
          Returns a parameter with a small perturbation of the value (if possible); never null.
 boolean similar(ScorerParam p)
          Returns true if the argument is signficantly different in value to this.
 java.lang.String toNameValueString()
          Generate the "name=value" text; never null or empty, though the value part may be empty.
 

Method Detail

perturb

ScorerParam perturb()
Returns a parameter with a small perturbation of the value (if possible); never null. If there is a bias in the perturbation direction then it is applied.

Returns:
legal value of same type as this, possibly with small perturbation applied

getName

java.lang.String getName()
Get the parameter name; never null or empty.


toNameValueString

java.lang.String toNameValueString()
Generate the "name=value" text; never null or empty, though the value part may be empty.


parse

ScorerParam parse(java.lang.String v)
Parse the String representation of a parameter returning a value of the same type; never null. If the argument is null or unparsable or out of range, then the result has the default value, else an instance with the requested parameter value is returned.

Returns:
legal value of the same type as this, with the parsed input String's value if possible

extract

ScorerParam extract(ScorerParam p)
Use the supplied parameter if possible (correct name/type/bounds), else return the default; never null.


similar

boolean similar(ScorerParam p)
Returns true if the argument is signficantly different in value to this. The result is false if the argument is null or of a completely different parameter type; no ClassCastException should be thrown (ie behaves like equals() rather than compareTo()).


DHD Multimedia Gallery V1.57.21

Copyright (c) 1996-2011, Damon Hart-Davis. All rights reserved.