Revision: 17655
          http://sourceforge.net/p/gate/code/17655
Author:   markagreenwood
Date:     2014-03-14 06:56:56 +0000 (Fri, 14 Mar 2014)
Log Message:
-----------
more generics clean up

Modified Paths:
--------------
    gate/trunk/src/main/gate/creole/ir/IndexStatistics.java
    gate/trunk/src/main/gate/creole/ir/QueryResult.java
    gate/trunk/src/main/gate/creole/ir/Search.java
    gate/trunk/src/main/gate/creole/ir/SearchPR.java
    gate/trunk/src/main/gate/creole/ir/lucene/LuceneIndexManager.java
    gate/trunk/src/main/gate/creole/ir/lucene/LuceneIndexStatistics.java
    gate/trunk/src/main/gate/creole/ir/lucene/LuceneSearch.java
    gate/trunk/src/main/gate/creole/orthomatcher/OrthoMatcher.java
    
gate/trunk/src/main/gate/creole/orthomatcher/SampleOrthoMatcher/SampleAnnotationOrthography.java
    gate/trunk/src/main/gate/util/ant/packager/GazetteerLists.java

Removed Paths:
-------------
    gate/trunk/src/main/gate/corpora/EventAwareCorpus.java
    gate/trunk/src/main/gate/corpora/EventAwareDocument.java
    gate/trunk/src/main/gate/corpora/EventAwareLanguageResource.java

Deleted: gate/trunk/src/main/gate/corpora/EventAwareCorpus.java
===================================================================
--- gate/trunk/src/main/gate/corpora/EventAwareCorpus.java      2014-03-14 
02:21:38 UTC (rev 17654)
+++ gate/trunk/src/main/gate/corpora/EventAwareCorpus.java      2014-03-14 
06:56:56 UTC (rev 17655)
@@ -1,32 +0,0 @@
-/*
- *  EventAwareCorpus.java
- *
- *  Copyright (c) 1995-2012, The University of Sheffield. See the file
- *  COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
- *
- *  This file is part of GATE (see http://gate.ac.uk/), and is free
- *  software, licenced under the GNU Library General Public License,
- *  Version 2, June 1991 (in the distribution as file licence.html,
- *  and also available at http://gate.ac.uk/gate/licence.html).
- *
- *  Marin Dimitrov, 06/Mar/2002
- *
- *
- *  $Id$
- */
-
-
-package gate.corpora;
-
-import java.util.List;
-
-
-public interface EventAwareCorpus extends EventAwareLanguageResource {
-
-  public List getLoadedDocuments();
-
-  public List getRemovedDocuments();
-
-  public List getAddedDocuments();
-
-}
\ No newline at end of file

Deleted: gate/trunk/src/main/gate/corpora/EventAwareDocument.java
===================================================================
--- gate/trunk/src/main/gate/corpora/EventAwareDocument.java    2014-03-14 
02:21:38 UTC (rev 17654)
+++ gate/trunk/src/main/gate/corpora/EventAwareDocument.java    2014-03-14 
06:56:56 UTC (rev 17655)
@@ -1,31 +0,0 @@
-/*
- *  EventAwareDocument.java
- *
- *  Copyright (c) 1995-2012, The University of Sheffield. See the file
- *  COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
- *
- *  This file is part of GATE (see http://gate.ac.uk/), and is free
- *  software, licenced under the GNU Library General Public License,
- *  Version 2, June 1991 (in the distribution as file licence.html,
- *  and also available at http://gate.ac.uk/gate/licence.html).
- *
- *  Marin Dimitrov, 08/Nov/2001
- *
- *
- *  $Id$
- */
-
-
-package gate.corpora;
-
-import java.util.Collection;
-
-
-public interface EventAwareDocument extends EventAwareLanguageResource {
-
-  public Collection getLoadedAnnotationSets();
-
-  public Collection getRemovedAnnotationSets();
-
-  public Collection getAddedAnnotationSets();
-}
\ No newline at end of file

Deleted: gate/trunk/src/main/gate/corpora/EventAwareLanguageResource.java
===================================================================
--- gate/trunk/src/main/gate/corpora/EventAwareLanguageResource.java    
2014-03-14 02:21:38 UTC (rev 17654)
+++ gate/trunk/src/main/gate/corpora/EventAwareLanguageResource.java    
2014-03-14 06:56:56 UTC (rev 17655)
@@ -1,32 +0,0 @@
-/*
- *  EventAwareLanguageResourcet.java
- *
- *  Copyright (c) 1995-2012, The University of Sheffield. See the file
- *  COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
- *
- *  This file is part of GATE (see http://gate.ac.uk/), and is free
- *  software, licenced under the GNU Library General Public License,
- *  Version 2, June 1991 (in the distribution as file licence.html,
- *  and also available at http://gate.ac.uk/gate/licence.html).
- *
- *  Marin Dimitrov, 06/Nov/2001
- *
- *  the interface is not public
- *
- *  $Id$
- */
-
-
-package gate.corpora;
-
-
-public interface EventAwareLanguageResource {
-
-  public static final int RES_NAME = 1001;
-  public static final int DOC_CONTENT = 1002;
-  public static final int RES_FEATURES = 1003;
-  public static final int DOC_MAIN = 1004;
-
-  public boolean isResourceChanged(int changeType);
-
-}
\ No newline at end of file

Modified: gate/trunk/src/main/gate/creole/ir/IndexStatistics.java
===================================================================
--- gate/trunk/src/main/gate/creole/ir/IndexStatistics.java     2014-03-14 
02:21:38 UTC (rev 17654)
+++ gate/trunk/src/main/gate/creole/ir/IndexStatistics.java     2014-03-14 
06:56:56 UTC (rev 17655)
@@ -27,6 +27,7 @@
 
   public Long getSpecificity(String term);
 
+  @SuppressWarnings("rawtypes")
   public Map getTermFrequency(Long docID, String fieldName);
 
 }
\ No newline at end of file

Modified: gate/trunk/src/main/gate/creole/ir/QueryResult.java
===================================================================
--- gate/trunk/src/main/gate/creole/ir/QueryResult.java 2014-03-14 02:21:38 UTC 
(rev 17654)
+++ gate/trunk/src/main/gate/creole/ir/QueryResult.java 2014-03-14 06:56:56 UTC 
(rev 17655)
@@ -26,10 +26,10 @@
   private float relevance;
 
   /** List of Terms*/
-  private List fieldValues;
+  private List<Term> fieldValues;
 
   /** Constructor of the class. */
-  public QueryResult(Object docID,float relevance, List fieldValues){
+  public QueryResult(Object docID,float relevance, List<Term> fieldValues){
     this.docID = docID;
     this.relevance = relevance;
     this.fieldValues = fieldValues;
@@ -46,7 +46,7 @@
   }
 
   /** returns certain document fields (if specified) from the search() call */
-  public List getFields(){
+  public List<Term> getFields(){
     return fieldValues;
   }
 

Modified: gate/trunk/src/main/gate/creole/ir/Search.java
===================================================================
--- gate/trunk/src/main/gate/creole/ir/Search.java      2014-03-14 02:21:38 UTC 
(rev 17654)
+++ gate/trunk/src/main/gate/creole/ir/Search.java      2014-03-14 06:56:56 UTC 
(rev 17655)
@@ -34,13 +34,13 @@
   /** Search in corpus with this query.
    *  In each QueryResult will be added values of these fields.
    *  Result length is unlimited. */
-  public QueryResultList search(String query, List fieldNames)
+  public QueryResultList search(String query, List<String> fieldNames)
                          throws IndexException, SearchException;
 
   /** Search in corpus with this query.
    *  In each QueryResult will be added values of these fields.
    *  Result length is limited. */
-  public QueryResultList search(String query, int limit, List fieldNames)
+  public QueryResultList search(String query, int limit, List<String> 
fieldNames)
                          throws IndexException, SearchException;
 
 }
\ No newline at end of file

Modified: gate/trunk/src/main/gate/creole/ir/SearchPR.java
===================================================================
--- gate/trunk/src/main/gate/creole/ir/SearchPR.java    2014-03-14 02:21:38 UTC 
(rev 17654)
+++ gate/trunk/src/main/gate/creole/ir/SearchPR.java    2014-03-14 06:56:56 UTC 
(rev 17655)
@@ -36,7 +36,7 @@
   private String searcherClassName = null;
   private QueryResultList resultList = null;
   private int limit = -1;
-  private List fieldNames = null;
+  private List<String> fieldNames = null;
 
   private Search searcher = null;
 
@@ -155,11 +155,11 @@
     return new Integer(this.limit);
   }
 
-  public void setFieldNames(List fieldNames){
+  public void setFieldNames(List<String> fieldNames){
     this.fieldNames = fieldNames;
   }
 
-  public List getFieldNames(){
+  public List<String> getFieldNames(){
     return this.fieldNames;
   }
 

Modified: gate/trunk/src/main/gate/creole/ir/lucene/LuceneIndexManager.java
===================================================================
--- gate/trunk/src/main/gate/creole/ir/lucene/LuceneIndexManager.java   
2014-03-14 02:21:38 UTC (rev 17654)
+++ gate/trunk/src/main/gate/creole/ir/lucene/LuceneIndexManager.java   
2014-03-14 06:56:56 UTC (rev 17655)
@@ -17,6 +17,7 @@
 package gate.creole.ir.lucene;
 
 import gate.Corpus;
+import gate.Document;
 import gate.creole.ir.IndexDefinition;
 import gate.creole.ir.IndexException;
 import gate.creole.ir.IndexField;
@@ -172,7 +173,7 @@
   /** Reindexing changed documents, removing removed documents and
    *  add to the index new corpus documents. */
   @Override
-  public void sync(List added, List removedIDs, List changed) throws 
IndexException{
+  public void sync(List<Document> added, List<String> removedIDs, 
List<Document> changed) throws IndexException{
     String location = indexDefinition.getIndexLocation();
     try {
 
@@ -186,7 +187,7 @@
       }//for (remove all removed documents)
 
       for (int i = 0; i<changed.size(); i++) {
-        gate.Document gateDoc = (gate.Document) changed.get(i);
+        gate.Document gateDoc = changed.get(i);
         String id = gateDoc.getLRPersistenceId().toString();
         org.apache.lucene.index.Term term =
                                new 
org.apache.lucene.index.Term(DOCUMENT_ID,id);
@@ -208,12 +209,12 @@
                               .setOpenMode(OpenMode.APPEND));      
 
       for(int i = 0; i<added.size(); i++) {
-        gate.Document gateDoc = (gate.Document) added.get(i);
+        gate.Document gateDoc = added.get(i);
         writer.addDocument(getLuceneDoc(gateDoc));
       }//for (add all added documents)
 
       for(int i = 0; i<changed.size(); i++) {
-        gate.Document gateDoc = (gate.Document) changed.get(i);
+        gate.Document gateDoc = changed.get(i);
         writer.addDocument(getLuceneDoc(gateDoc));
       }//for (add all changed documents)
 

Modified: gate/trunk/src/main/gate/creole/ir/lucene/LuceneIndexStatistics.java
===================================================================
--- gate/trunk/src/main/gate/creole/ir/lucene/LuceneIndexStatistics.java        
2014-03-14 02:21:38 UTC (rev 17654)
+++ gate/trunk/src/main/gate/creole/ir/lucene/LuceneIndexStatistics.java        
2014-03-14 06:56:56 UTC (rev 17655)
@@ -48,6 +48,7 @@
     return null;
   }
 
+  @SuppressWarnings("rawtypes")
   @Override
   public Map getTermFrequency(Long docID, String fieldName){
     //NOT IMPLEMENTED YET

Modified: gate/trunk/src/main/gate/creole/ir/lucene/LuceneSearch.java
===================================================================
--- gate/trunk/src/main/gate/creole/ir/lucene/LuceneSearch.java 2014-03-14 
02:21:38 UTC (rev 17654)
+++ gate/trunk/src/main/gate/creole/ir/lucene/LuceneSearch.java 2014-03-14 
06:56:56 UTC (rev 17655)
@@ -65,7 +65,7 @@
    *  In each QueryResult will be added values of theise fields.
    *  Result length is limited by DEFAULTMAXRESULTS. */
   @Override
-  public QueryResultList search(String query, List fieldNames)
+  public QueryResultList search(String query, List<String> fieldNames)
                                          throws IndexException, 
SearchException{
     return search(query, DEFAULTMAXRESULTS, fieldNames);
   }
@@ -74,7 +74,7 @@
    *  In each QueryResult will be added values of these fields.
    *  Result length is limited. */
   @Override
-  public QueryResultList search(String query, int limit, List fieldNames)
+  public QueryResultList search(String query, int limit, List<String> 
fieldNames)
                                          throws IndexException, 
SearchException{
     
     List<QueryResult> result = new Vector<QueryResult>();
@@ -107,8 +107,8 @@
           fieldValues = new Vector<Term>();
           for (int j=0; j<fieldNames.size(); j++){
             fieldValues.add(new Term( 
-                    fieldNames.get(j).toString(), 
-                    
searcher.doc(hits[i].doc).get(fieldNames.get(j).toString()))
+                    fieldNames.get(j), 
+                    searcher.doc(hits[i].doc).get(fieldNames.get(j)))
             );
           }
         }

Modified: gate/trunk/src/main/gate/creole/orthomatcher/OrthoMatcher.java
===================================================================
--- gate/trunk/src/main/gate/creole/orthomatcher/OrthoMatcher.java      
2014-03-14 02:21:38 UTC (rev 17654)
+++ gate/trunk/src/main/gate/creole/orthomatcher/OrthoMatcher.java      
2014-03-14 06:56:56 UTC (rev 17655)
@@ -1053,6 +1053,7 @@
    * @param name2
    * @return  true if the two names indicate the same person
    */
+  @SuppressWarnings("unused")
   private boolean pairwise_person_name_match(String name1, String name2) {
     String shortName,longName;
     if (name1.length() > name2.length()) {
@@ -1315,6 +1316,7 @@
    * and
    * Cynthia Morgan de Rothschild == Cynthia de Rothschild
    */
+  @SuppressWarnings("unused")
   public boolean noMatchRule2(String s1,String s2) {
     if (normalizedTokensLongAnnot.size()>2 && 
normalizedTokensShortAnnot.size()>2) {
       boolean retval = false;

Modified: 
gate/trunk/src/main/gate/creole/orthomatcher/SampleOrthoMatcher/SampleAnnotationOrthography.java
===================================================================
--- 
gate/trunk/src/main/gate/creole/orthomatcher/SampleOrthoMatcher/SampleAnnotationOrthography.java
    2014-03-14 02:21:38 UTC (rev 17654)
+++ 
gate/trunk/src/main/gate/creole/orthomatcher/SampleOrthoMatcher/SampleAnnotationOrthography.java
    2014-03-14 06:56:56 UTC (rev 17655)
@@ -18,8 +18,12 @@
  */
 public class SampleAnnotationOrthography implements 
gate.creole.orthomatcher.AnnotationOrthography {
     
+  @SuppressWarnings("unused")
   private final String personType;
+  
   private final AnnotationOrthography defaultOrthography;
+  
+  @SuppressWarnings("unused")
   private final boolean extLists;
   
   public SampleAnnotationOrthography(String personType, boolean extLists,

Modified: gate/trunk/src/main/gate/util/ant/packager/GazetteerLists.java
===================================================================
--- gate/trunk/src/main/gate/util/ant/packager/GazetteerLists.java      
2014-03-14 02:21:38 UTC (rev 17654)
+++ gate/trunk/src/main/gate/util/ant/packager/GazetteerLists.java      
2014-03-14 06:56:56 UTC (rev 17655)
@@ -57,7 +57,7 @@
    * ResourceCollection interface: returns an iterator over the list
    * files.
    */
-  @SuppressWarnings("rawtypes")
+  @SuppressWarnings({"rawtypes","unchecked"})
   @Override
   public Iterator iterator() {
     load();

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to