X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Fjsite%2Fcore%2FNode.java;h=b3a98e9980659081e15f4638706d9ac30b534560;hb=d7781e42fca4b06cdbf40e806c22a96e534f235d;hp=854a668df32c47db9c01a05f636240304ef50bfb;hpb=bcb9cebfa11ffbfee8ee8e5579edeed302e2d784;p=jSite2.git
diff --git a/src/net/pterodactylus/jsite/core/Node.java b/src/net/pterodactylus/jsite/core/Node.java
index 854a668..b3a98e9 100644
--- a/src/net/pterodactylus/jsite/core/Node.java
+++ b/src/net/pterodactylus/jsite/core/Node.java
@@ -21,7 +21,7 @@ package net.pterodactylus.jsite.core;
/**
* Container for a Freenet node.
- *
+ *
* @author David âBombeâ Roden <bombe@freenetproject.org>
* @version $Id$
*/
@@ -36,12 +36,9 @@ public class Node {
/** The port number of the node. */
private int port;
- /** Whether the node is running on the same machine as jSite. */
- private boolean sameMachine;
-
/**
* Returns the user-given name of the node.
- *
+ *
* @return The name of the node
*/
public String getName() {
@@ -50,7 +47,7 @@ public class Node {
/**
* Sets the user-given name of the node.
- *
+ *
* @param name
* The name of the node
*/
@@ -60,7 +57,7 @@ public class Node {
/**
* Returns the hostname of the node.
- *
+ *
* @return The hostname of the node
*/
public String getHostname() {
@@ -69,7 +66,7 @@ public class Node {
/**
* Sets the hostname of the node.
- *
+ *
* @param hostname
* The hostname of the node
*/
@@ -79,7 +76,7 @@ public class Node {
/**
* Returns the port number of the node.
- *
+ *
* @return The port number of the node
*/
public int getPort() {
@@ -88,7 +85,7 @@ public class Node {
/**
* Sets the port number of the node.
- *
+ *
* @param port
* The port number of the node
*/
@@ -97,24 +94,16 @@ public class Node {
}
/**
- * Returns whether this node is running on the same machine as jSite.
- *
- * @return the sameMachine true
if, and only if, the node is
- * running on the same machine as jSite
+ * {@inheritDoc} Two Node objects are considered equal if their hostnames
+ * and their port numbers are equal.
*/
- public boolean isSameMachine() {
- return sameMachine;
- }
-
- /**
- * Sets whether this node is running on the same machine as jSite.
- *
- * @param sameMachine
- * true
if the node is running on the same machine
- * as jSite, false
otherwise
- */
- public void setSameMachine(boolean sameMachine) {
- this.sameMachine = sameMachine;
+ @Override
+ public boolean equals(Object object) {
+ if ((object == null) || !(object instanceof Node)) {
+ return false;
+ }
+ Node node = (Node) object;
+ return hostname.equals(node.hostname) && port == node.port;
}
/**