Rename TSVal
This commit is contained in:
parent
a1453da84e
commit
d87e227ff3
29 changed files with 118 additions and 118 deletions
|
|
@ -39,7 +39,7 @@ type Iterator struct {
|
|||
collection string
|
||||
}
|
||||
|
||||
func NewIterator(ts *TripleStore, collection string, d graph.Direction, val graph.TSVal) *Iterator {
|
||||
func NewIterator(ts *TripleStore, collection string, d graph.Direction, val graph.Value) *Iterator {
|
||||
var m Iterator
|
||||
iterator.BaseInit(&m.Base)
|
||||
|
||||
|
|
@ -109,7 +109,7 @@ func (it *Iterator) Clone() graph.Iterator {
|
|||
return newM
|
||||
}
|
||||
|
||||
func (it *Iterator) Next() (graph.TSVal, bool) {
|
||||
func (it *Iterator) Next() (graph.Value, bool) {
|
||||
var result struct {
|
||||
Id string "_id"
|
||||
//Sub string "Sub"
|
||||
|
|
@ -128,7 +128,7 @@ func (it *Iterator) Next() (graph.TSVal, bool) {
|
|||
return result.Id, true
|
||||
}
|
||||
|
||||
func (it *Iterator) Check(v graph.TSVal) bool {
|
||||
func (it *Iterator) Check(v graph.Value) bool {
|
||||
graph.CheckLogIn(it, v)
|
||||
if it.isAll {
|
||||
it.Last = v
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ func (ts *TripleStore) RemoveTriple(t *graph.Triple) {
|
|||
}
|
||||
}
|
||||
|
||||
func (ts *TripleStore) Triple(val graph.TSVal) *graph.Triple {
|
||||
func (ts *TripleStore) Triple(val graph.Value) *graph.Triple {
|
||||
var bsonDoc bson.M
|
||||
err := ts.db.C("triples").FindId(val.(string)).One(&bsonDoc)
|
||||
if err != nil {
|
||||
|
|
@ -223,7 +223,7 @@ func (ts *TripleStore) Triple(val graph.TSVal) *graph.Triple {
|
|||
}
|
||||
}
|
||||
|
||||
func (ts *TripleStore) TripleIterator(d graph.Direction, val graph.TSVal) graph.Iterator {
|
||||
func (ts *TripleStore) TripleIterator(d graph.Direction, val graph.Value) graph.Iterator {
|
||||
return NewIterator(ts, "triples", d, val)
|
||||
}
|
||||
|
||||
|
|
@ -235,11 +235,11 @@ func (ts *TripleStore) TriplesAllIterator() graph.Iterator {
|
|||
return NewAllIterator(ts, "triples")
|
||||
}
|
||||
|
||||
func (ts *TripleStore) ValueOf(s string) graph.TSVal {
|
||||
func (ts *TripleStore) ValueOf(s string) graph.Value {
|
||||
return ts.ConvertStringToByteHash(s)
|
||||
}
|
||||
|
||||
func (ts *TripleStore) NameOf(v graph.TSVal) string {
|
||||
func (ts *TripleStore) NameOf(v graph.Value) string {
|
||||
val, ok := ts.idCache.Get(v.(string))
|
||||
if ok {
|
||||
return val
|
||||
|
|
@ -262,7 +262,7 @@ func (ts *TripleStore) Size() int64 {
|
|||
return int64(count)
|
||||
}
|
||||
|
||||
func compareStrings(a, b graph.TSVal) bool {
|
||||
func compareStrings(a, b graph.Value) bool {
|
||||
return a.(string) == b.(string)
|
||||
}
|
||||
|
||||
|
|
@ -274,7 +274,7 @@ func (ts *TripleStore) Close() {
|
|||
ts.db.Session.Close()
|
||||
}
|
||||
|
||||
func (ts *TripleStore) TripleDirection(in graph.TSVal, d graph.Direction) graph.TSVal {
|
||||
func (ts *TripleStore) TripleDirection(in graph.Value, d graph.Direction) graph.Value {
|
||||
// Maybe do the trick here
|
||||
var offset int
|
||||
switch d {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue