[Mulgara-svn] r2106 - in trunk/src/jar: client-jrdf/java/org/mulgara/client/jrdf/util query/java/org/jrdf/graph

pag at mulgara.org pag at mulgara.org
Fri May 11 20:42:40 UTC 2012


Author: pag
Date: 2012-05-11 20:42:39 +0000 (Fri, 11 May 2012)
New Revision: 2106

Modified:
   trunk/src/jar/client-jrdf/java/org/mulgara/client/jrdf/util/NodeComparator.java
   trunk/src/jar/client-jrdf/java/org/mulgara/client/jrdf/util/ObjectNodeComparator.java
   trunk/src/jar/client-jrdf/java/org/mulgara/client/jrdf/util/PredicateNodeComparator.java
   trunk/src/jar/client-jrdf/java/org/mulgara/client/jrdf/util/SPOComparator.java
   trunk/src/jar/client-jrdf/java/org/mulgara/client/jrdf/util/SubjectNodeComparator.java
   trunk/src/jar/query/java/org/jrdf/graph/Alternative.java
   trunk/src/jar/query/java/org/jrdf/graph/Bag.java
Log:
Fixed up sloppy templating that is no longer allowed in JDK 1.7

Modified: trunk/src/jar/client-jrdf/java/org/mulgara/client/jrdf/util/NodeComparator.java
===================================================================
--- trunk/src/jar/client-jrdf/java/org/mulgara/client/jrdf/util/NodeComparator.java	2012-05-11 20:42:31 UTC (rev 2105)
+++ trunk/src/jar/client-jrdf/java/org/mulgara/client/jrdf/util/NodeComparator.java	2012-05-11 20:42:39 UTC (rev 2106)
@@ -90,7 +90,7 @@
    * @param node2 Object
    * @return int
    */
-  public int compare(Object node1, Object node2) {
+  public int compare(T node1, T node2) {
 
     //validate
     if (! (node1 instanceof Node)) {
@@ -103,7 +103,7 @@
       throw new IllegalArgumentException("'node2' is not a JRDF Node. node2: " + node1);
     }
 
-    return this.compare( (Node) node1, (Node) node2);
+    return this.nodeCompare( (Node) node1, (Node) node2);
   }
 
   /**
@@ -113,7 +113,7 @@
    * @param node2 Node
    * @return int
    */
-  protected int compare(Node node1, Node node2) {
+  protected int nodeCompare(Node node1, Node node2) {
 
     //value to be returned
     int compare = 0;
@@ -131,13 +131,13 @@
       //determine types and call appropriate method
       if (nodeValue1 == URI_NODE_VALUE) {
 
-        compare = this.compare( (URIReference) node1, (URIReference) node2);
+        compare = this.nodeCompare( (URIReference) node1, (URIReference) node2);
       } else if (nodeValue1 == LITERAL_NODE_VALUE) {
 
-        compare = this.compare( (Literal) node1, (Literal) node2);
+        compare = this.nodeCompare( (Literal) node1, (Literal) node2);
       } else if (nodeValue1 == BLANK_NODE_VALUE) {
 
-        compare = this.compare( (BlankNode) node1, (BlankNode) node2);
+        compare = this.nodeCompare( (BlankNode) node1, (BlankNode) node2);
       } else {
 
         //should not get here...
@@ -157,13 +157,13 @@
    * @param node2 URIReference
    * @return int
    */
-  private int compare(URIReference node1, URIReference node2) {
+  private int nodeCompare(URIReference node1, URIReference node2) {
 
     //convert to String
     String uri1 = node1.getURI().toString();
     String uri2 = node2.getURI().toString();
 
-    return this.compare(uri1, uri2);
+    return this.nodeCompare(uri1, uri2);
   }
 
   /**
@@ -173,13 +173,13 @@
    * @param node2 BlankNode
    * @return int
    */
-  private int compare(BlankNode node1, BlankNode node2) {
+  private int nodeCompare(BlankNode node1, BlankNode node2) {
 
     //convert to String
     String string1 = node1.toString();
     String string2 = node2.toString();
 
-    return this.compare(string1, string2);
+    return this.nodeCompare(string1, string2);
   }
 
   /**
@@ -189,13 +189,13 @@
    * @param node2 Literal
    * @return int
    */
-  private int compare(Literal node1, Literal node2) {
+  private int nodeCompare(Literal node1, Literal node2) {
 
     //convert to String
     String string1 = node1.getLexicalForm();
     String string2 = node2.getLexicalForm();
 
-    return this.compare(string1, string2);
+    return this.nodeCompare(string1, string2);
   }
 
   /**
@@ -205,7 +205,7 @@
    * @param string2 String
    * @return int
    */
-  private int compare(String string1, String string2) {
+  private int nodeCompare(String string1, String string2) {
 
     return string1.compareTo(string2);
   }

Modified: trunk/src/jar/client-jrdf/java/org/mulgara/client/jrdf/util/ObjectNodeComparator.java
===================================================================
--- trunk/src/jar/client-jrdf/java/org/mulgara/client/jrdf/util/ObjectNodeComparator.java	2012-05-11 20:42:31 UTC (rev 2105)
+++ trunk/src/jar/client-jrdf/java/org/mulgara/client/jrdf/util/ObjectNodeComparator.java	2012-05-11 20:42:39 UTC (rev 2106)
@@ -82,6 +82,6 @@
     }
 
     //compare objects
-    return super.compare(triple1.getObject(), triple2.getObject());
+    return super.nodeCompare(triple1.getObject(), triple2.getObject());
   }
 }

Modified: trunk/src/jar/client-jrdf/java/org/mulgara/client/jrdf/util/PredicateNodeComparator.java
===================================================================
--- trunk/src/jar/client-jrdf/java/org/mulgara/client/jrdf/util/PredicateNodeComparator.java	2012-05-11 20:42:31 UTC (rev 2105)
+++ trunk/src/jar/client-jrdf/java/org/mulgara/client/jrdf/util/PredicateNodeComparator.java	2012-05-11 20:42:39 UTC (rev 2106)
@@ -82,6 +82,6 @@
     }
 
     //compare predicates
-    return super.compare(triple1.getPredicate(), triple2.getPredicate());
+    return super.nodeCompare(triple1.getPredicate(), triple2.getPredicate());
   }
 }

Modified: trunk/src/jar/client-jrdf/java/org/mulgara/client/jrdf/util/SPOComparator.java
===================================================================
--- trunk/src/jar/client-jrdf/java/org/mulgara/client/jrdf/util/SPOComparator.java	2012-05-11 20:42:31 UTC (rev 2105)
+++ trunk/src/jar/client-jrdf/java/org/mulgara/client/jrdf/util/SPOComparator.java	2012-05-11 20:42:39 UTC (rev 2106)
@@ -91,14 +91,14 @@
     }
 
     //compare by subject first
-    int subjectCompare = super.compare(triple1.getSubject(), triple2.getSubject());
+    int subjectCompare = super.nodeCompare(triple1.getSubject(), triple2.getSubject());
     if (subjectCompare != 0) {
 
       return subjectCompare;
     }
 
     //subjects are equal, compare predicates
-    int predicateCompare = super.compare(triple1.getPredicate(),
+    int predicateCompare = super.nodeCompare(triple1.getPredicate(),
                                          triple2.getPredicate());
     if (predicateCompare != 0) {
 
@@ -106,6 +106,6 @@
     }
 
     //subjects and predicates are equal, return the object result
-    return super.compare(triple1.getObject(), triple2.getObject());
+    return super.nodeCompare(triple1.getObject(), triple2.getObject());
   }
 }

Modified: trunk/src/jar/client-jrdf/java/org/mulgara/client/jrdf/util/SubjectNodeComparator.java
===================================================================
--- trunk/src/jar/client-jrdf/java/org/mulgara/client/jrdf/util/SubjectNodeComparator.java	2012-05-11 20:42:31 UTC (rev 2105)
+++ trunk/src/jar/client-jrdf/java/org/mulgara/client/jrdf/util/SubjectNodeComparator.java	2012-05-11 20:42:39 UTC (rev 2106)
@@ -82,6 +82,6 @@
     }
 
     //compare subjects
-    return super.compare(triple1.getSubject(), triple2.getSubject());
+    return super.nodeCompare(triple1.getSubject(), triple2.getSubject());
   }
 }

Modified: trunk/src/jar/query/java/org/jrdf/graph/Alternative.java
===================================================================
--- trunk/src/jar/query/java/org/jrdf/graph/Alternative.java	2012-05-11 20:42:31 UTC (rev 2105)
+++ trunk/src/jar/query/java/org/jrdf/graph/Alternative.java	2012-05-11 20:42:39 UTC (rev 2106)
@@ -78,7 +78,7 @@
     * @throws IllegalArgumentException if the given object is not the correct
     *   type, Alternative.
     */
-   boolean containsAll(Collection<ObjectNode> c)
+   boolean containsAll(Collection<?> c)
        throws IllegalArgumentException;
 
    /**
@@ -87,7 +87,7 @@
     * @throws IllegalArgumentException if the given object is not the correct
     *   type, Alternative.
     */
-   boolean addAll(Collection<ObjectNode> c)
+   boolean addAll(Collection<? extends ObjectNode> c)
        throws IllegalArgumentException;
 
    /**
@@ -96,7 +96,7 @@
     * @throws IllegalArgumentException if the given object is not the correct
     *   type, Alternative.
     */
-   boolean removeAll(Collection<ObjectNode> c)
+   boolean removeAll(Collection<?> c)
        throws IllegalArgumentException;
 
    /**
@@ -105,6 +105,6 @@
     * @throws IllegalArgumentException if the given object is not the correct
     *   type, Alternative.
     */
-   boolean retainAll(Collection<ObjectNode> c)
+   boolean retainAll(Collection<?> c)
        throws IllegalArgumentException;
 }

Modified: trunk/src/jar/query/java/org/jrdf/graph/Bag.java
===================================================================
--- trunk/src/jar/query/java/org/jrdf/graph/Bag.java	2012-05-11 20:42:31 UTC (rev 2105)
+++ trunk/src/jar/query/java/org/jrdf/graph/Bag.java	2012-05-11 20:42:39 UTC (rev 2106)
@@ -79,7 +79,7 @@
    * @throws IllegalArgumentException if the given object is not the correct
    *   type, Bag.
    */
-  boolean containsAll(Collection<ObjectNode> c)
+  boolean containsAll(Collection<?> c)
       throws IllegalArgumentException;
 
   /**
@@ -89,7 +89,7 @@
    * @throws IllegalArgumentException if the given object is not the correct
    *   type, Bag.
    */
-  boolean addAll(Collection<ObjectNode> c) throws IllegalArgumentException;
+  boolean addAll(Collection<? extends ObjectNode> c) throws IllegalArgumentException;
 
   /**
    * ${@inheritDoc}
@@ -98,7 +98,7 @@
    * @throws IllegalArgumentException if the given object is not the correct
    *   type, Bag.
    */
-  boolean removeAll(Collection<ObjectNode> c) throws IllegalArgumentException;
+  boolean removeAll(Collection<?> c) throws IllegalArgumentException;
 
   /**
    * ${@inheritDoc}
@@ -107,5 +107,5 @@
    * @throws IllegalArgumentException if the given object is not the correct
    *   type, Bag.
    */
-  boolean retainAll(Collection<ObjectNode> c) throws IllegalArgumentException;
+  boolean retainAll(Collection<?> c) throws IllegalArgumentException;
 }



More information about the Mulgara-svn mailing list