| 22 | import pcgen.cdom.base.Loadable; |
| 23 | |
| 24 | public class BonusSpellInfo implements Loadable |
| 25 | { |
| 26 | |
| 27 | private URI sourceURI; |
| 28 | private int statRange; |
| 29 | private int spellLevel; |
| 30 | private int statScore; |
| 31 | |
| 32 | @Override |
| 33 | public URI getSourceURI() |
| 34 | { |
| 35 | return sourceURI; |
| 36 | } |
| 37 | |
| 38 | @Override |
| 39 | public void setSourceURI(URI source) |
| 40 | { |
| 41 | sourceURI = source; |
| 42 | } |
| 43 | |
| 44 | @Override |
| 45 | public void setName(String name) |
| 46 | { |
| 47 | try |
| 48 | { |
| 49 | int intValue = Integer.valueOf(name); |
| 50 | if (intValue < 1) |
| 51 | { |
| 52 | throw new IllegalArgumentException("Name must be an integer >= 1"); |
| 53 | } |
| 54 | spellLevel = intValue; |
| 55 | } |
| 56 | catch (NumberFormatException nfe) |
| 57 | { |
| 58 | throw new IllegalArgumentException("Name must be an integer, found: " + name, nfe); |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | @Override |
| 63 | public String getDisplayName() |
| 64 | { |
| 65 | return String.valueOf(spellLevel); |
| 66 | } |
| 67 | |
| 68 | @Override |
| 69 | public String getKeyName() |
| 70 | { |
| 71 | return getDisplayName(); |
| 72 | } |
| 73 | |
| 74 | @Override |
| 75 | public boolean isInternal() |
| 76 | { |
| 77 | return false; |
| 78 | } |
| 79 | |
| 80 | @Override |
| 81 | public boolean isType(String type) |
nothing calls this directly
no outgoing calls
no test coverage detected