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/07/01 20:01:02 UTC
svn commit: r1142010 -
/incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EzGraph.scala
Author: bblfish
Date: Fri Jul 1 18:01:02 2011
New Revision: 1142010
URL: http://svn.apache.org/viewvc?rev=1142010&view=rev
Log:
CLEREZZA-510 remove duplicate code in EzLiteral. Reduce to minimum.
Modified:
incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EzGraph.scala
Modified: incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EzGraph.scala
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EzGraph.scala?rev=1142010&r1=1142009&r2=1142010&view=diff
==============================================================================
--- incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EzGraph.scala (original)
+++ incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EzGraph.scala Fri Jul 1 18:01:02 2011
@@ -27,7 +27,7 @@ import java.util.Date
import collection.mutable.{ListBuffer, HashMap}
import org.apache.clerezza.rdf.utils.{GraphNode, UnionMGraph}
import org.apache.clerezza.rdf.core._
-import org.apache.clerezza.rdf.core.impl._
+import impl._
object EzGraph {
@@ -70,9 +70,7 @@ object EzGraph {
* An easy Literal implementations, contains functions for mapping literals to other literals, ie from String literals to
* typed literals.
*/
-class EzLiteral(lexicalForm: String) extends TypedLiteral {
-
- def unapply(lexical: String) = lexical
+class EzLiteral(lexicalForm: String) extends TypedLiteralImpl(lexicalForm,XSD.string) {
/**
* @return a plain literal with language specified by lang
@@ -90,27 +88,6 @@ class EzLiteral(lexicalForm: String) ext
*/
def uri = new UriRef(lexicalForm)
- /**
- * get the pure string
- */
- override def getLexicalForm = lexicalForm
-
- override def equals(other: Any) = {
- other match {
- case olit: TypedLiteral => (olit eq this) || (olit.getLexicalForm == lexicalForm && olit.getDataType == this.getDataType)
- case _ => false
- }
- }
-
- override def hashCode() = XSD.string.hashCode() + lexicalForm.hashCode()
-
- def getDataType = XSD.string
-
- /**
- * String literals are just strings
- * See RDF Semantics rules xsd 1a and xsd 1b in http://www.w3.org/TR/rdf-mt/
- */
- override def toString() = lexicalForm
}
/**