This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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)) |
OlderNewer