Reduce TripleStore interface names

This commit is contained in:
kortschak 2014-07-02 11:40:33 +09:30
parent 8576f66d20
commit b89d4f392c
29 changed files with 156 additions and 156 deletions

View file

@ -217,11 +217,11 @@ func (ts *TripleStore) RemoveTriple(t *graph.Triple) {
}
}
func (ts *TripleStore) GetTriple(index graph.TSVal) *graph.Triple {
func (ts *TripleStore) Triple(index graph.TSVal) *graph.Triple {
return &ts.triples[index.(int64)]
}
func (ts *TripleStore) GetTripleIterator(d graph.Direction, value graph.TSVal) graph.Iterator {
func (ts *TripleStore) TripleIterator(d graph.Direction, value graph.TSVal) graph.Iterator {
index, ok := ts.index.Get(d, value.(int64))
data := fmt.Sprintf("dir:%s val:%d", d, value.(int64))
if ok {
@ -243,15 +243,15 @@ func (ts *TripleStore) DebugPrint() {
}
}
func (ts *TripleStore) GetIdFor(name string) graph.TSVal {
func (ts *TripleStore) ValueOf(name string) graph.TSVal {
return ts.idMap[name]
}
func (ts *TripleStore) GetNameFor(id graph.TSVal) string {
func (ts *TripleStore) NameOf(id graph.TSVal) string {
return ts.revIdMap[id.(int64)]
}
func (ts *TripleStore) GetTriplesAllIterator() graph.Iterator {
func (ts *TripleStore) TriplesAllIterator() graph.Iterator {
return iterator.NewInt64(0, ts.Size())
}
@ -259,12 +259,12 @@ func (ts *TripleStore) FixedIterator() graph.FixedIterator {
return iterator.NewFixedIteratorWithCompare(iterator.BasicEquality)
}
func (ts *TripleStore) GetTripleDirection(val graph.TSVal, d graph.Direction) graph.TSVal {
name := ts.GetTriple(val).Get(d)
return ts.GetIdFor(name)
func (ts *TripleStore) TripleDirection(val graph.TSVal, d graph.Direction) graph.TSVal {
name := ts.Triple(val).Get(d)
return ts.ValueOf(name)
}
func (ts *TripleStore) GetNodesAllIterator() graph.Iterator {
func (ts *TripleStore) NodesAllIterator() graph.Iterator {
return NewMemstoreAllIterator(ts)
}
func (ts *TripleStore) Close() {}