3 * Copyright (C) 2006 David Roden
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 package de.todesbaum.jsite.application;
23 * @author David Roden <droden@gmail.com>
26 public class Node extends de.todesbaum.util.freenet.fcp2.Node {
28 protected String name;
33 public Node(String hostname) {
34 this(hostname, DEFAULT_PORT);
41 public Node(String hostname, int port) {
42 this(hostname, port, "");
45 public Node(String hostname, int port, String name) {
46 super(hostname, port);
50 public Node(Node node) {
51 this(node.getHostname(), node.getPort());
54 public Node(Node node, String name) {
55 this(node.getHostname(), node.getPort(), name);
62 public void setName(String name) {
67 * @return Returns the name.
69 public String getName() {
73 public void setHostname(String hostname) {
74 this.hostname = hostname;
77 public void setPort(int port) {
82 public boolean equals(Object o) {
83 if ((o == null) || !(o instanceof Node)) {
87 return name.equals(node.name) && hostname.equals(node.hostname) && (port == node.port);
91 public int hashCode() {
92 return name.hashCode() ^ hostname.hashCode() ^ port;
96 public String toString() {
97 return name + " (" + hostname + ":" + port + ")";