You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@clerezza.apache.org by re...@apache.org on 2011/03/07 14:34:13 UTC
svn commit: r1078774 -
/incubator/clerezza/issues/CLEREZZA-388/rdf.cris/core/src/main/scala/org/apache/clerezza/rdf/cris/TermRangeCondition.scala
Author: reto
Date: Mon Mar 7 13:34:12 2011
New Revision: 1078774
URL: http://svn.apache.org/viewvc?rev=1078774&view=rev
Log:
CLEREZZA-388: Added TermRangeCondition
Added:
incubator/clerezza/issues/CLEREZZA-388/rdf.cris/core/src/main/scala/org/apache/clerezza/rdf/cris/TermRangeCondition.scala
Added: incubator/clerezza/issues/CLEREZZA-388/rdf.cris/core/src/main/scala/org/apache/clerezza/rdf/cris/TermRangeCondition.scala
URL: http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-388/rdf.cris/core/src/main/scala/org/apache/clerezza/rdf/cris/TermRangeCondition.scala?rev=1078774&view=auto
==============================================================================
--- incubator/clerezza/issues/CLEREZZA-388/rdf.cris/core/src/main/scala/org/apache/clerezza/rdf/cris/TermRangeCondition.scala (added)
+++ incubator/clerezza/issues/CLEREZZA-388/rdf.cris/core/src/main/scala/org/apache/clerezza/rdf/cris/TermRangeCondition.scala Mon Mar 7 13:34:12 2011
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.clerezza.rdf.cris
+
+import org.apache.clerezza.rdf.core.UriRef
+import org.apache.lucene.search.Query
+import org.apache.lucene.search.TermRangeQuery
+
+case class TermRangeCondition(property: VirtualProperty, lowerTerm: String, upperTerm: String,
+ includeUpper: Boolean, includeLower: Boolean) extends Condition {
+
+ def this(uriRefProperty: UriRef, lowerTerm: String, upperTerm: String,
+ includeUpper: Boolean, includeLower: Boolean) = this(new PropertyHolder(uriRefProperty),
+ lowerTerm: String, upperTerm: String,includeUpper: Boolean, includeLower: Boolean)
+
+ def query: Query = new TermRangeQuery(property.stringKey, lowerTerm, upperTerm, includeUpper, includeLower)
+
+}
+
+object TermRangeCondition {
+ def apply(uriRefProperty: UriRef, lowerTerm: String, upperTerm: String,
+ includeUpper: Boolean, includeLower: Boolean) =
+ new TermRangeCondition(uriRefProperty, lowerTerm, upperTerm,
+ includeUpper, includeLower)
+}
\ No newline at end of file