Creates a specification for generating records, as a $GENERATE statement in a master file. @param start The start of the range. @param end The end of the range. @param step The step value of the range. @param namePattern The pattern to use for generating record names. @param type The type of the gen
(long start, long end, long step, String namePattern, int type, int dclass, long ttl, String rdataPattern, Name origin)
| 71 | * @throws IllegalArgumentException The dclass is not a valid class. |
| 72 | */ |
| 73 | public |
| 74 | Generator(long start, long end, long step, String namePattern, |
| 75 | int type, int dclass, long ttl, String rdataPattern, Name origin) |
| 76 | { |
| 77 | if (start < 0 || end < 0 || start > end || step <= 0) |
| 78 | throw new IllegalArgumentException |
| 79 | ("invalid range specification"); |
| 80 | if (!supportedType(type)) |
| 81 | throw new IllegalArgumentException("unsupported type"); |
| 82 | DClass.check(dclass); |
| 83 | |
| 84 | this.start = start; |
| 85 | this.end = end; |
| 86 | this.step = step; |
| 87 | this.namePattern = namePattern; |
| 88 | this.type = type; |
| 89 | this.dclass = dclass; |
| 90 | this.ttl = ttl; |
| 91 | this.rdataPattern = rdataPattern; |
| 92 | this.origin = origin; |
| 93 | this.current = start; |
| 94 | } |
| 95 | |
| 96 | private String |
| 97 | substitute(String spec, long n) throws IOException { |
nothing calls this directly
no test coverage detected