jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rve...@apache.org
Subject svn commit: r1439831 - in /jena/trunk/jena-arq/src: main/java/org/apache/jena/riot/system/ test/java/org/apache/jena/riot/system/
Date Tue, 29 Jan 2013 11:04:33 GMT
Author: rvesse
Date: Tue Jan 29 11:04:33 2013
New Revision: 1439831

URL: http://svn.apache.org/viewvc?rev=1439831&view=rev
Log:
Rename FastPrefixMap to FastAbbreviatingPrefixMap

Added:
    jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/FastAbbreviatingPrefixMap.java
      - copied, changed from r1439810, jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/FastPrefixMap.java
    jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestFastAbbreviatingPrefixMap.java
      - copied, changed from r1439830, jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestFastPrefixMap.java
Removed:
    jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/FastPrefixMap.java
    jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestFastPrefixMap.java
Modified:
    jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMap.java
    jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TS_RiotSystem.java
    jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestAbbreviationPerformance.java

Copied: jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/FastAbbreviatingPrefixMap.java
(from r1439810, jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/FastPrefixMap.java)
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/FastAbbreviatingPrefixMap.java?p2=jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/FastAbbreviatingPrefixMap.java&p1=jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/FastPrefixMap.java&r1=1439810&r2=1439831&rev=1439831&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/FastPrefixMap.java (original)
+++ jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/FastAbbreviatingPrefixMap.java
Tue Jan 29 11:04:33 2013
@@ -45,38 +45,37 @@ import com.hp.hpl.jena.shared.PrefixMapp
  * To improve on output performance this implementation maintains a {@link Trie}
  * mapping namespace IRIs to their prefixes as well as a normal mapping.
  * Therefore IRI abbreviation can be done as an approximately O(1) operation in
- * the worst case (ignoring the vagaries of {@link HashMap} performance since
- * that underpins the {@link Trie} implementation). If you contrast this with
- * the abbreviation performance of the default {@link PrefixMap} which is worst
- * case O(n) then this is a substantial saving in scenarios where you primarily
- * use a prefix map for output.
+ * the worst case . If you contrast this with the abbreviation performance of
+ * the default {@code PrefixMap} which is worst case O(n) then this is a
+ * substantial saving in scenarios where you primarily use a prefix map for
+ * output.
  * </p>
  * <p>
  * Generally speaking all other operations should be roughly equivalent to the
- * default {@link PrefixMap} though the memory overhead of this implementation
+ * default {@code PrefixMap} though the memory overhead of this implementation
  * will be marginally higher due to the extra information maintained in the
- * {@link Trie}.
+ * {@code Trie}.
  * </p>
  */
-public class FastPrefixMap extends LightweightPrefixMapBase {
+public class FastAbbreviatingPrefixMap extends LightweightPrefixMapBase {
 
     private Map<String, IRI> prefixes = new HashMap<String, IRI>();
     private Map<String, IRI> prefixesView = Collections.unmodifiableMap(this.prefixes);
     private Trie<String> abbrevs = new Trie<String>();
 
     /**
-     * Create a new fast prefix map
+     * Create a new fast abbreviating prefix map
      */
-    public FastPrefixMap() {
+    public FastAbbreviatingPrefixMap() {
     }
 
     /**
-     * Create a new prefix map which copies mappings from an existing map
+     * Create a new fast abbreviating prefix map which copies mappings from an existing map
      * 
      * @param pmap
      *            Prefix Map
      */
-    public FastPrefixMap(LightweightPrefixMap pmap) {
+    public FastAbbreviatingPrefixMap(LightweightPrefixMap pmap) {
         this.putAll(pmap);
     }
 

Modified: jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMap.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMap.java?rev=1439831&r1=1439830&r2=1439831&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMap.java (original)
+++ jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMap.java Tue Jan 29
11:04:33 2013
@@ -32,11 +32,11 @@ import org.apache.jena.iri.IRIFactory;
 import com.hp.hpl.jena.shared.PrefixMapping;
 
 /**
- * Default implementation of a {@link LightweightPrefixMap}, this implementation
+ * Default implementation of a {@code LightweightPrefixMap}, this implementation
  * is best suited to use for input.
  * <p>
  * If you are using this primarily to abbreviate URIs for output consider using
- * the {@link FastPrefixMap} instead which offers much better abbreviation
+ * the {@link FastAbbreviatingPrefixMap} instead which offers much better abbreviation
  * performance.
  */
 public class PrefixMap extends LightweightPrefixMapBase {

Modified: jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TS_RiotSystem.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TS_RiotSystem.java?rev=1439831&r1=1439830&r2=1439831&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TS_RiotSystem.java (original)
+++ jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TS_RiotSystem.java Tue Jan
29 11:04:33 2013
@@ -32,7 +32,7 @@ import org.junit.runners.Suite.SuiteClas
     
     // Prefix Map implementations
     , TestPrefixMap.class
-    , TestFastPrefixMap.class
+    , TestFastAbbreviatingPrefixMap.class
     // May be subject to performance vagaries, often passes in Eclipse 
     // and not on maven command line so excluded for now
     //, TestAbbreviationPerformance.class

Modified: jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestAbbreviationPerformance.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestAbbreviationPerformance.java?rev=1439831&r1=1439830&r2=1439831&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestAbbreviationPerformance.java
(original)
+++ jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestAbbreviationPerformance.java
Tue Jan 29 11:04:33 2013
@@ -30,11 +30,11 @@ public class TestAbbreviationPerformance
     /**
      * Compares the performance of looking up every namespace 1000 times
      * @param normal PrefixMap
-     * @param fast FastPrefixMap
+     * @param fast FastAbbreviatingPrefixMap
      * @param namespaces Number of namespaces
-     * @param fastShouldWin Whether the FastPrefixMap should outperform the PrefixMap
+     * @param fastShouldWin Whether the FastAbbreviatingPrefixMap should outperform the PrefixMap
      */
-    private void test_amalgamated_performance(PrefixMap normal, FastPrefixMap fast, int namespaces,
boolean fastShouldWin) {
+    private void test_amalgamated_performance(PrefixMap normal, FastAbbreviatingPrefixMap
fast, int namespaces, boolean fastShouldWin) {
         long nPerf = 0, fPerf = 0;
         
         for (int i = 1; i <= namespaces; i++) {
@@ -49,10 +49,10 @@ public class TestAbbreviationPerformance
 
         if (fastShouldWin) {
             if (fPerf > nPerf)
-                Assert.fail("Expected FastPrefixMap to outperform PrefixMap");
+                Assert.fail("Expected FastAbbreviatingPrefixMap to outperform PrefixMap");
         } else {
             if (nPerf > fPerf)
-                Assert.fail("Expected PrefixMap to outperform FastPrefixMap");
+                Assert.fail("Expected PrefixMap to outperform FastAbbreviatingPrefixMap");
         }
     }
 
@@ -72,70 +72,70 @@ public class TestAbbreviationPerformance
     }
 
     /**
-     * Expect {@link PrefixMap} to outperform {@link FastPrefixMap} when there
+     * Expect {@link PrefixMap} to outperform {@link FastAbbreviatingPrefixMap} when there
      * is a single namespace
      */
     @Test
     public void prefixMap_abbrev_performance_01() {
         PrefixMap pmap = new PrefixMap();
         populate(pmap, 1);
-        FastPrefixMap fmap = new FastPrefixMap();
+        FastAbbreviatingPrefixMap fmap = new FastAbbreviatingPrefixMap();
         populate(fmap, 1);
 
         test_amalgamated_performance(pmap, fmap, 1, false);
     }
 
     /**
-     * Expect {@link FastPrefixMap} to outperform {@link PrefixMap} as soon as
+     * Expect {@link FastAbbreviatingPrefixMap} to outperform {@link PrefixMap} as soon as
      * there are a few namespaces
      */
     @Test
     public void prefixMap_abbrev_performance_02() {
         PrefixMap pmap = new PrefixMap();
         populate(pmap, 2);
-        FastPrefixMap fmap = new FastPrefixMap();
+        FastAbbreviatingPrefixMap fmap = new FastAbbreviatingPrefixMap();
         populate(fmap, 2);
 
         test_amalgamated_performance(pmap, fmap, 2, true);
     }
 
     /**
-     * Expect {@link FastPrefixMap} to outperform {@link PrefixMap} as soon as
+     * Expect {@link FastAbbreviatingPrefixMap} to outperform {@link PrefixMap} as soon as
      * there are a few namespaces
      */
     @Test
     public void prefixMap_abbrev_performance_03() {
         PrefixMap pmap = new PrefixMap();
         populate(pmap, 5);
-        FastPrefixMap fmap = new FastPrefixMap();
+        FastAbbreviatingPrefixMap fmap = new FastAbbreviatingPrefixMap();
         populate(fmap, 5);
 
         test_amalgamated_performance(pmap, fmap, 5, true);
     }
 
     /**
-     * Expect {@link FastPrefixMap} to significantly outperform
+     * Expect {@link FastAbbreviatingPrefixMap} to significantly outperform
      * {@link PrefixMap} once there are a good number of namespaces
      */
     @Test
     public void prefixMap_abbrev_performance_04() {
         PrefixMap pmap = new PrefixMap();
         populate(pmap, 20);
-        FastPrefixMap fmap = new FastPrefixMap();
+        FastAbbreviatingPrefixMap fmap = new FastAbbreviatingPrefixMap();
         populate(fmap, 20);
 
         test_amalgamated_performance(pmap, fmap, 20, true);
     }
     
     /**
-     * Expect {@link FastPrefixMap} to significantly outperform
+     * Expect {@link FastAbbreviatingPrefixMap} to significantly outperform
      * {@link PrefixMap} once there are a good number of namespaces
      */
     @Test
     public void prefixMap_abbrev_performance_05() {
         PrefixMap pmap = new PrefixMap();
         populate(pmap, 100);
-        FastPrefixMap fmap = new FastPrefixMap();
+        FastAbbreviatingPrefixMap fmap = new FastAbbreviatingPrefixMap();
         populate(fmap, 100);
 
         test_amalgamated_performance(pmap, fmap, 100, true);

Copied: jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestFastAbbreviatingPrefixMap.java
(from r1439830, jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestFastPrefixMap.java)
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestFastAbbreviatingPrefixMap.java?p2=jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestFastAbbreviatingPrefixMap.java&p1=jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestFastPrefixMap.java&r1=1439830&r2=1439831&rev=1439831&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestFastPrefixMap.java (original)
+++ jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestFastAbbreviatingPrefixMap.java
Tue Jan 29 11:04:33 2013
@@ -19,14 +19,14 @@
 package org.apache.jena.riot.system;
 
 /**
- * Tests the {@link FastPrefixMap} implementation
+ * Tests the {@link FastAbbreviatingPrefixMap} implementation
  *
  */
-public class TestFastPrefixMap extends AbstractTestLightweightPrefixMap {
+public class TestFastAbbreviatingPrefixMap extends AbstractTestLightweightPrefixMap {
 
     @Override
     protected LightweightPrefixMap getPrefixMap() {
-        return new FastPrefixMap();
+        return new FastAbbreviatingPrefixMap();
     }
 
 }



Mime
View raw message