Generates a new Name with the first n labels replaced by a wildcard @return The wildcard name
(int n)
| 458 | * @return The wildcard name |
| 459 | */ |
| 460 | public Name |
| 461 | wild(int n) { |
| 462 | if (n < 1) |
| 463 | throw new IllegalArgumentException("must replace 1 or more " + |
| 464 | "labels"); |
| 465 | try { |
| 466 | Name newname = new Name(); |
| 467 | copy(wild, newname); |
| 468 | newname.append(name, offset(n), getlabels() - n); |
| 469 | return newname; |
| 470 | } |
| 471 | catch (NameTooLongException e) { |
| 472 | throw new IllegalStateException |
| 473 | ("Name.wild: concatenate failed"); |
| 474 | } |
| 475 | } |
| 476 | |
| 477 | /** |
| 478 | * Returns a canonicalized version of the Name (all lowercase). This may be |