KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > cluster > Node


1 /*
2  * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright
3  * notice. All rights reserved.
4  */

5 package com.tc.cluster;
6
7 public class Node {
8   private final String JavaDoc nodeId;
9
10   public Node(final String JavaDoc nodeId) {
11     this.nodeId = nodeId;
12   }
13
14   public String JavaDoc getNodeId() {
15     return nodeId;
16   }
17
18   public boolean equals(Object JavaDoc obj) {
19     if (!(obj instanceof Node)) return false;
20     Node that = (Node) obj;
21     return this.nodeId.equals(that.nodeId);
22   }
23
24   public int hashCode() {
25     return nodeId.hashCode();
26   }
27
28   public String JavaDoc toString() {
29     return nodeId;
30   }
31 }
32
Popular Tags