2 * jFCPlib - ARK.java - Copyright © 2008 David Roden
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 package net.pterodactylus.fcp;
22 * Container for ARKs (address resolution keys).
24 * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
28 /** The public URI of the ARK. */
29 private final String publicURI;
31 /** The private URI of the ARK. */
32 private final String privateURI;
34 /** The number of the ARK. */
35 private final int number;
38 * Creates a new ARK with the given URI and number.
41 * The public URI of the ARK
43 * The number of the ARK
45 public ARK(String publicURI, String number) {
46 this(publicURI, null, number);
50 * Creates a new ARK with the given URIs and number.
53 * The public URI of the ARK
55 * The private URI of the ARK
57 * The number of the ARK
59 public ARK(String publicURI, String privateURI, String number) {
60 if ((publicURI == null) || (number == null)) {
61 throw new NullPointerException(((publicURI == null) ? "publicURI" : "number") + " must not be null");
63 this.publicURI = publicURI;
64 this.privateURI = privateURI;
66 this.number = Integer.valueOf(number);
67 } catch (NumberFormatException nfe1) {
68 throw new IllegalArgumentException("number must be numeric", nfe1);
73 * Returns the public URI of the ARK.
75 * @return The public URI of the ARK
77 public String getPublicURI() {
82 * Returns the private URI of the ARK.
84 * @return The private URI of the ARK
86 public String getPrivateURI() {
91 * Returns the number of the ARK.
93 * @return The number of the ARK
95 public int getNumber() {