1 package net.sourceforge.rpgee.dice;
2
3 import net.sourceforge.rpgee.Describable;
4 import net.sourceforge.rpgee.dice.exceptions.InvalidParameterException;
5
6
7 public interface RandomValueResultMapper extends Describable {
8 /**
9 * Mappers map integer values to some string representation
10 *
11 * @param value integer value to map
12 * @return String map of the int value
13 * @throws InvalidParameterException if the value cannot be mapped (probably per isMappableValue)
14 */
15 public String getMappedValue(int value) throws InvalidParameterException;
16
17 /**
18 * Determines if a value can be mapped. For fail-early processing, it just calls the getLowestMappableValue/getHigestMappableValue function
19 *
20 * @param value
21 * @return
22 */
23 public boolean isMappableValue(int value);
24
25 /**
26 * The lowest integer value that is mappable by this mapper
27 * @return lowest int value that can be mapped
28 */
29 public int getLowestMappableValue();
30
31 /**
32 * The highest integer value that is mappable by this mapper
33 * @return highest int value that can be mapped
34 */
35 public int getHighestMappableValue();
36
37 }