Revision: 14859
          http://gate.svn.sourceforge.net/gate/?rev=14859&view=rev
Author:   adamfunk
Date:     2011-12-23 21:09:52 +0000 (Fri, 23 Dec 2011)
Log Message:
-----------
Made ImmutableAnnotationSetImpl's constructor public, and amended the
Factory method accordingly.

Simplified the gate.Utils.get[...]Annotations(...) methods to use the
source AS's document reference for creating the
ImmutableAnnotationSetImpl.

Modified Paths:
--------------
    gate/trunk/src/gate/Factory.java
    gate/trunk/src/gate/Utils.java
    gate/trunk/src/gate/annotation/ImmutableAnnotationSetImpl.java

Modified: gate/trunk/src/gate/Factory.java
===================================================================
--- gate/trunk/src/gate/Factory.java    2011-12-23 18:20:24 UTC (rev 14858)
+++ gate/trunk/src/gate/Factory.java    2011-12-23 21:09:52 UTC (rev 14859)
@@ -480,9 +480,7 @@
    */
   public static AnnotationSet createImmutableAnnotationSet(Document document, 
           Collection<Annotation> annotations) {
-    return new ImmutableAnnotationSetImpl(document, annotations){
-      private static final long serialVersionUID = -6703131102439043539L;
-    };
+    return new ImmutableAnnotationSetImpl(document, annotations);
   }
   
   /**

Modified: gate/trunk/src/gate/Utils.java
===================================================================
--- gate/trunk/src/gate/Utils.java      2011-12-23 18:20:24 UTC (rev 14858)
+++ gate/trunk/src/gate/Utils.java      2011-12-23 21:09:52 UTC (rev 14859)
@@ -410,9 +410,7 @@
     AnnotationSet containingAnnotationSet,
     String targetType) {
     if(containingAnnotationSet.isEmpty() || sourceAnnotationSet.isEmpty()) {
-      return new ImmutableAnnotationSetImpl(null,null) { 
-        private static final long serialVersionUID = -6703131102439043539L;
-      };
+      return 
Factory.createImmutableAnnotationSet(sourceAnnotationSet.getDocument(), null);
     }
     if(targetType.equals("")) {
       return sourceAnnotationSet.getContained(
@@ -498,9 +496,7 @@
     AnnotationSet coveredAnnotationSet,
     String targetType) {
     if(coveredAnnotationSet.isEmpty() || sourceAnnotationSet.isEmpty()) {
-      return new ImmutableAnnotationSetImpl(null,null) {
-        private static final long serialVersionUID = -2222340068293006646L; 
-      };
+      return 
Factory.createImmutableAnnotationSet(sourceAnnotationSet.getDocument(), null);
     }
     return sourceAnnotationSet.getCovering(targetType,
         coveredAnnotationSet.firstNode().getOffset(),
@@ -592,9 +588,7 @@
     AnnotationSet overlappedAnnotationSet,
     String targetType) {
     if(overlappedAnnotationSet.isEmpty() || sourceAnnotationSet.isEmpty()) {
-      return new ImmutableAnnotationSetImpl(null,null) {
-        private static final long serialVersionUID = 65686974132550005L;
-      };
+      return 
Factory.createImmutableAnnotationSet(sourceAnnotationSet.getDocument(), null);
     }
     
     if ( (targetType == null) || targetType.isEmpty()) {

Modified: gate/trunk/src/gate/annotation/ImmutableAnnotationSetImpl.java
===================================================================
--- gate/trunk/src/gate/annotation/ImmutableAnnotationSetImpl.java      
2011-12-23 18:20:24 UTC (rev 14858)
+++ gate/trunk/src/gate/annotation/ImmutableAnnotationSetImpl.java      
2011-12-23 21:09:52 UTC (rev 14859)
@@ -18,7 +18,7 @@
    * 
    * @param annotations
    */
-  protected ImmutableAnnotationSetImpl(Document doc,
+  public ImmutableAnnotationSetImpl(Document doc,
           Collection<Annotation> annotations) throws ClassCastException {
     super(doc);
     if(annotations != null) {

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


------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to