blob: 23ecb4ed38778bb234b451df92a535c5b1fe821f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Chapter5.support;
import java.util.Comparator;
/**
*
* @author shamanth
*/
public class NodeSizeComparator implements Comparator
{
public int compare(Object o1, Object o2)
{
int size1 = ((NetworkNode) o1).size;
int size2 = ((NetworkNode) o2).size;
if(size1>size2)
{
return 1;
}
if(size1<size2)
return -1;
else
return 0;
}
}
|