diff options
author | Peter Wu <peter@lekensteyn.nl> | 2014-04-23 12:22:20 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2014-04-23 12:22:20 +0200 |
commit | 14d7547cd31c5be878e377a4a5370f604c8d59d4 (patch) | |
tree | 003840f1a21d39b07d45cd3112c38b6eed40e3ab /src/Chapter5/support/NodeSizeComparator.java | |
download | TwitterDataAnalytics-14d7547cd31c5be878e377a4a5370f604c8d59d4.tar.gz |
Initial commit
build.xml, etc. are modified a bit after opening in Netbeans 7.4.
Diffstat (limited to 'src/Chapter5/support/NodeSizeComparator.java')
-rw-r--r-- | src/Chapter5/support/NodeSizeComparator.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/Chapter5/support/NodeSizeComparator.java b/src/Chapter5/support/NodeSizeComparator.java new file mode 100644 index 0000000..23ecb4e --- /dev/null +++ b/src/Chapter5/support/NodeSizeComparator.java @@ -0,0 +1,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; + } + +} |