incubator-ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tm...@apache.org
Subject svn commit: r1445570 - /incubator/ctakes/trunk/ctakes-utils/src/main/java/org/apache/ctakes/utils/struct/CounterTreeMap.java
Date Wed, 13 Feb 2013 12:31:40 GMT
Author: tmill
Date: Wed Feb 13 12:31:40 2013
New Revision: 1445570

URL: http://svn.apache.org/r1445570
Log:
Fixed small bug in utility class that only I use.

Modified:
    incubator/ctakes/trunk/ctakes-utils/src/main/java/org/apache/ctakes/utils/struct/CounterTreeMap.java

Modified: incubator/ctakes/trunk/ctakes-utils/src/main/java/org/apache/ctakes/utils/struct/CounterTreeMap.java
URL: http://svn.apache.org/viewvc/incubator/ctakes/trunk/ctakes-utils/src/main/java/org/apache/ctakes/utils/struct/CounterTreeMap.java?rev=1445570&r1=1445569&r2=1445570&view=diff
==============================================================================
--- incubator/ctakes/trunk/ctakes-utils/src/main/java/org/apache/ctakes/utils/struct/CounterTreeMap.java
(original)
+++ incubator/ctakes/trunk/ctakes-utils/src/main/java/org/apache/ctakes/utils/struct/CounterTreeMap.java
Wed Feb 13 12:31:40 2013
@@ -7,13 +7,13 @@ import java.util.TreeMap;
 // This class is a simplifying class which makes it easy to build hashes to keep track of
counts
 // and write less boilerplate code.  If you just call it with an object, it will increment
the
 // object's count by 1, initializing it to zero first if necessary.
-public class CounterTreeMap<K> implements Comparator<K>{
+public class CounterTreeMap<K> {
 
 //	IntValueComparator<K> comp = new IntValueComparator<K>();
 	TreeMap<K,Integer> map = null;
 	
 	public CounterTreeMap(){
-		map = new TreeMap<K,Integer>(this);
+		map = new TreeMap<K,Integer>();
 //		super(this);
 	}
 	
@@ -33,11 +33,14 @@ public class CounterTreeMap<K> implement
 		map.put(key, map.get(key)+i);
 	}
 
-
-	@Override
-	public int compare(K o1, K o2) {
-		return map.get(o1) - map.get(o2);
+	public int size(){
+		return map.size();
 	}
+	
+//	@Override
+//	public int compare(K o1, K o2) {
+//		return o1 - o2;
+//	}
 
 	public Set<K> keySet() {
 		return map.keySet();



Mime
View raw message