Last change
on this file since 8 was
8,
checked in by gnappo, 14 years ago
|
Aggiunta la libreria Jung per lavorare con i grafi. Primi esperimenti. A breve riorganizzazione completa del codice per usufruire della libreria.
|
File size:
458 bytes
|
Line | |
---|
1 | package weka.clusterers.forMetisMQI; |
---|
2 | |
---|
3 | public class Node { |
---|
4 | |
---|
5 | private String id; |
---|
6 | |
---|
7 | public Node(String id) { |
---|
8 | this.id = id; |
---|
9 | } |
---|
10 | |
---|
11 | @Override |
---|
12 | public boolean equals(Object o) { |
---|
13 | return (o instanceof Node) && (((Node)o).getId().equals(id)); |
---|
14 | } |
---|
15 | |
---|
16 | @Override |
---|
17 | public int hashCode() { |
---|
18 | int hash = 1; |
---|
19 | hash = hash * 31 + id.hashCode(); |
---|
20 | return hash; |
---|
21 | } |
---|
22 | |
---|
23 | public String getId() { |
---|
24 | return id; |
---|
25 | } |
---|
26 | |
---|
27 | @Override |
---|
28 | public String toString() { |
---|
29 | return "N" + id; |
---|
30 | } |
---|
31 | |
---|
32 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.