ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tm...@apache.org
Subject svn commit: r1477364 - in /ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup: AbstractBaseDictionary.java BaseDictionaryImpl.java BaseMetaDataHitImpl.java GenericMetaDataHitImpl.java MetaDataHitComparator.java
Date Mon, 29 Apr 2013 21:47:57 GMT
Author: tmill
Date: Mon Apr 29 21:47:57 2013
New Revision: 1477364

URL: http://svn.apache.org/r1477364
Log:
ctakes-159: modified package dictionary.lookup to use generics. (fixed a few other minor things
causing warnings).

Modified:
    ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/AbstractBaseDictionary.java
    ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/BaseDictionaryImpl.java
    ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/BaseMetaDataHitImpl.java
    ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/GenericMetaDataHitImpl.java
    ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/MetaDataHitComparator.java

Modified: ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/AbstractBaseDictionary.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/AbstractBaseDictionary.java?rev=1477364&r1=1477363&r2=1477364&view=diff
==============================================================================
--- ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/AbstractBaseDictionary.java
(original)
+++ ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/AbstractBaseDictionary.java
Mon Apr 29 21:47:57 2013
@@ -34,7 +34,7 @@ public abstract class AbstractBaseDictio
     * TODO - get rid of the using class iterators and use Collection foreach
     * @return iterator of all metaField names
     */
-    protected Iterator getMetaFieldNames() {
+    protected Iterator<String> getMetaFieldNames() {
         return _metaFieldNames.iterator();
     }
 

Modified: ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/BaseDictionaryImpl.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/BaseDictionaryImpl.java?rev=1477364&r1=1477363&r2=1477364&view=diff
==============================================================================
--- ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/BaseDictionaryImpl.java
(original)
+++ ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/BaseDictionaryImpl.java
Mon Apr 29 21:47:57 2013
@@ -33,9 +33,9 @@ import java.util.Set;
 @Deprecated
 public abstract class BaseDictionaryImpl implements Dictionary
 {
-    private Set iv_metaFieldNames = new HashSet();
+    private Set<String> iv_metaFieldNames = new HashSet<String>();
 
-    protected Iterator getMetaFieldNames()
+    protected Iterator<String> getMetaFieldNames()
     {
         return iv_metaFieldNames.iterator();
     }

Modified: ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/BaseMetaDataHitImpl.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/BaseMetaDataHitImpl.java?rev=1477364&r1=1477363&r2=1477364&view=diff
==============================================================================
--- ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/BaseMetaDataHitImpl.java
(original)
+++ ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/BaseMetaDataHitImpl.java
Mon Apr 29 21:47:57 2013
@@ -61,7 +61,7 @@ public abstract class BaseMetaDataHitImp
              || !getMetaFieldNames().containsAll( mdh.getMetaFieldNames() ) ) {
           return false;
        }
-       final Collection<String> thisMetaFieldNames = (Collection<String>)getMetaFieldNames();
+       final Collection<String> thisMetaFieldNames = getMetaFieldNames();
        for ( String name : thisMetaFieldNames ) {
           if ( !getMetaFieldValue( name ).equals( mdh.getMetaFieldValue( name ) ) ) {
              return false;

Modified: ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/GenericMetaDataHitImpl.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/GenericMetaDataHitImpl.java?rev=1477364&r1=1477363&r2=1477364&view=diff
==============================================================================
--- ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/GenericMetaDataHitImpl.java
(original)
+++ ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/GenericMetaDataHitImpl.java
Mon Apr 29 21:47:57 2013
@@ -28,7 +28,7 @@ import java.util.Set;
  * @author Mayo Clinic
  */
 @Immutable
-public final class GenericMetaDataHitImpl extends AbstractBaseMetaDataHit implements MetaDataHit
{
+public final class GenericMetaDataHitImpl extends AbstractBaseMetaDataHit {
    private final Map<String, String> _nameValueMap;
 
    public GenericMetaDataHitImpl( final Map<String,String> metaNameValueMap ) {

Modified: ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/MetaDataHitComparator.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/MetaDataHitComparator.java?rev=1477364&r1=1477363&r2=1477364&view=diff
==============================================================================
--- ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/MetaDataHitComparator.java
(original)
+++ ctakes/trunk/ctakes-dictionary-lookup/src/main/java/org/apache/ctakes/dictionary/lookup/MetaDataHitComparator.java
Mon Apr 29 21:47:57 2013
@@ -26,7 +26,7 @@ import java.util.Comparator;
  * 
  * @author Mayo Clinic
  */
-public class MetaDataHitComparator implements Comparator, MetaDataHitConst
+public class MetaDataHitComparator implements Comparator<MetaDataHit>, MetaDataHitConst
 {
     private int iv_type;
     private String iv_metaFieldName;
@@ -48,11 +48,8 @@ public class MetaDataHitComparator imple
     /**
      * Implementation
      */
-    public int compare(Object o1, Object o2)
+    public int compare(MetaDataHit mdh1, MetaDataHit mdh2)
     {
-        MetaDataHit mdh1 = (MetaDataHit) o1;
-        MetaDataHit mdh2 = (MetaDataHit) o2;
-
         String mdv1 = mdh1.getMetaFieldValue(iv_metaFieldName);
         String mdv2 = mdh2.getMetaFieldValue(iv_metaFieldName);
 
@@ -78,9 +75,6 @@ public class MetaDataHitComparator imple
         {
             return comparison;
         }
-        else
-        {
-            return comparison * -1;
-        }
+        return comparison * -1;
     }
 }
\ No newline at end of file



Mime
View raw message