Changeset 9 for src/main/java/weka/clusterers/forMetisMQI/Node.java
- Timestamp:
- Sep 14, 2010, 2:11:28 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/weka/clusterers/forMetisMQI/Node.java
r8 r9 1 1 package weka.clusterers.forMetisMQI; 2 2 3 3 4 public class Node { 4 5 5 6 private String id; 6 7 8 /** The weight of the node */ 9 private int vwgt; 10 /** The size of the adjacency list of the node */ 11 private int nedges; 12 /** 13 * The index into the adjacency list that is the beginning of the adjacency 14 * list of v 15 */ 16 private int iedges; 17 /** The weight of the edges that have been contracted to create the node */ 18 private int cewgt; 19 /** The sum of the weight of the edges adjacent to v */ 20 private int adjwgt; 21 7 22 public Node(String id) { 8 23 this.id = id; 24 this.vwgt = 1; 25 this.cewgt = 0; 26 this.iedges = 0; 27 this.nedges = 0; 28 this.adjwgt = 0; 9 29 } 10 30 11 31 @Override 12 32 public boolean equals(Object o) { 13 return (o instanceof Node) && (((Node) o).getId().equals(id));33 return (o instanceof Node) && (((Node) o).getId().equals(id)); 14 34 } 15 35 16 36 @Override 17 37 public int hashCode() { … … 24 44 return id; 25 45 } 26 46 27 47 @Override 28 48 public String toString() { … … 30 50 } 31 51 52 public int getVwgt() { 53 return vwgt; 54 } 55 56 public void setVwgt(int vwgt) { 57 this.vwgt = vwgt; 58 } 59 60 public int getNedges() { 61 return nedges; 62 } 63 64 public void setNedges(int nedges) { 65 this.nedges = nedges; 66 } 67 68 public int getIedges() { 69 return iedges; 70 } 71 72 public void setIedges(int iedges) { 73 this.iedges = iedges; 74 } 75 76 public int getCewgt() { 77 return cewgt; 78 } 79 80 public void setCewgt(int cewgt) { 81 this.cewgt = cewgt; 82 } 83 84 public int getAdjwgt() { 85 return adjwgt; 86 } 87 88 public void setAdjwgt(int adjwgt) { 89 this.adjwgt = adjwgt; 90 } 91 92 @Override 93 public Node clone() { 94 Node n = new Node(id); 95 n.adjwgt = adjwgt; 96 n.cewgt = cewgt; 97 n.iedges = iedges; 98 n.nedges = nedges; 99 n.vwgt = vwgt; 100 return n; 101 } 102 32 103 }
Note: See TracChangeset
for help on using the changeset viewer.