This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def findX(name:String, keys: (HGSortIndex[K,V], K) => HGSearchResult[V], disc:(Ordering[K],K,K) => Boolean) : | |
(name, (index:S, dataSeq:Seq[(K,Seq[V])]) => Try | |
{ | |
val allTrue = dataSeq.forall{ case (key, valueSeq) => | |
{ | |
val b :HGSearchResult[V]= keys(index, key) | |
val ordering = implicitly[Ordering[K]] | |
val c = dataSeq.filter( pair => disc(ordering, pair._1, | |
key)).map(_._1).toSet | |
b.forall(key => c.contains(key)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val validatations : Seq[(String, (S,Seq[(K,Seq[V])]) => Try[Boolean])]= | |
Seq( | |
("def findLT(key: K)", (index:S, dataSeq:Seq[(K,Seq[V])]) => Try | |
{ | |
val allTrue = dataSeq.forall{ case (key, valueSeq) => | |
{ | |
val b = index.findLT(key) | |
val ordering = implicitly[Ordering[K]] | |
val c = dataSeq.filter( pair => ordering.lt(pair._1, key)).map(_._1).toSet | |
b.forall(key => c.contains(key)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static HGHandle linkLine(String [] stations, HyperGraph graph){ | |
HGHandle[] stationHandles = new HGHandle[stations.length]; | |
for (int i = 0; i < stations.length; i++){ | |
stationHandles[i] = hg.assertAtom(graph, stations[i]); | |
} | |
return graph.add(new HGPlainLink(stationHandles)); | |
} | |
public static void main(String[] args) { | |
HyperGraph graph = new HyperGraph("//home/ingvar/bin/sbt-KK/bje"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object TestTransa { | |
import org.hypergraphdb.transaction.HGUserAbortException | |
import scala.runtime.NonLocalReturnControl | |
import org.hypergraphdb._ | |
import HGQuery.hg | |
import java.lang.Throwable | |
import scala.annotation.tailrec | |
val graph:HyperGraph = new HyperGraph("/home/ingvar/bin/sbt-scala-hypergraphdb/bje") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.hypergraphdb.storage.hazelstore; | |
public enum Ordr | |
{ | |
LT, LTE, GT, GTE | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.hypergraphdb.storage; | |
import java.util.Arrays; | |
import java.io.Serializable; | |
public class BAWrapper implements Serializable{ | |
private final byte[] data; | |
public BAWrapper(byte[] data) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object HGHandleHacks { | |
implicit def richHandle(handle: HGHandle)(implicit graph: HyperGraph) = new { | |
// DEREFERENCING | |
// dereference and type cast - may throw ClassCastException | |
def d[T](implicit graph: HyperGraph): T = | |
graph.get(handle).asInstanceOf[T] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package hgtest.storage | |
import org.hypergraphdb._ | |
import collection.JavaConversions._ | |
import org.hypergraphdb.HGQuery.hg | |
import org.hypergraphdb.query.AtomTypeCondition | |
import org.hypergraphdb.util.HGUtils | |
import storage.bje.BJEStorageImplementation | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import test.JHGDB.TestCommons._ | |
import org.hypergraphdb.HGQuery.hg | |
import scala.collection.JavaConversions._ | |
import org.hypergraphdb.query.AtomTypeCondition | |
import test.Text.Word3 | |
import java.util.ArrayList | |
import org.hypergraphdb.indexing.{ByTargetIndexer, ByPartIndexer} | |
import org.hypergraphdb.{HyperGraph, HGHandle, HGPlainLink} | |
object HGDBRecursiveTextTest { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test | |
import scala.annotation.tailrec | |
import scala.collection.JavaConversions._ | |
import scala.reflect.BeanProperty | |
sealed abstract class Text{ | |
override def toString():String | |
//ToDo -- checkout Type bounds |
NewerOlder