public class NodeOfMac implements Comparable {
//MACå°å
private long value;
//计æ°å¨
private int counter;
public NodeOfMac() {
this.value = 0;
this.counter = 0;
}
public NodeOfMac(long value,int counter) {
this.value = value;
this.counter = counter;
}
/**
* 设置èç¹çMACå°å
*
* @param value Long Integer
*/
public void setValue(long value) {
this.value = value;
}
/**
* 设置MACå°åç计æ°å¨
*
* @param counter Integer
*/
public void setCounter(int counter) {
this.counter = counter;
}
/**
* è¿åèç¹çMACå°å
*
* @return
*/
public long getValue() {
return this.value;
}
/**
* è¿åèç¹å¯¹åºç计æ°å¨
*
* @return
*/
public String getCounter() {
return String.valueOf(counter);
}
@Override
public int compareTo(NodeOfMac o) {
if (this.getValue() > o.getValue()) {
return 1;
} else if (this.getValue() < o.getValue()) {
return -1;
}
else
return 0;
}
@Override
public String toString () {
return this.getCounter();
}
}