You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@clerezza.apache.org by bb...@apache.org on 2011/06/23 19:35:41 UTC

svn commit: r1139010 - /incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EasyGraph.scala

Author: bblfish
Date: Thu Jun 23 17:35:40 2011
New Revision: 1139010

URL: http://svn.apache.org/viewvc?rev=1139010&view=rev
Log:
CLEREZZA-510 adds constructor for java.collections. Fixes compile breakages in the accountcontrolpanel.

Modified:
    incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EasyGraph.scala

Modified: incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EasyGraph.scala
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EasyGraph.scala?rev=1139010&r1=1139009&r2=1139010&view=diff
==============================================================================
--- incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EasyGraph.scala (original)
+++ incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EasyGraph.scala Thu Jun 23 17:35:40 2011
@@ -26,9 +26,9 @@ import org.apache.clerezza.rdf.utils.Uni
 import org.apache.clerezza.rdf.utils.GraphNode
 import scala.collection.mutable.HashMap
 import org.apache.clerezza.rdf.ontologies.{XSD, RDF}
-import java.util.{HashSet, Date}
 import org.apache.clerezza.rdf.core._
 import impl._
+import java.util.{HashSet, Date}
 
 object EasyGraph {
 
@@ -119,6 +119,14 @@ class EasyGraph(val graph: HashSet[Tripl
 	**/
 	def this() = this (new HashSet[Triple])
 
+
+	/**
+	 * Constructor for collection
+	 * Because superclasses map copy information to a new HashSet, we do this now, so that this class can keep
+	 * track of the container. If super class changes this may become unnecessary
+	 */
+	def this(tripleColl: java.util.Collection[Triple]) = this(new HashSet[Triple](tripleColl))
+
 	def +=(other: Graph) = {
 		if (graph ne other) graph.addAll(other)
 	}