@Override public long estimatedNumResults() { return iterator.estimatedNumResults(); }
@Override public boolean hasNext() { return iterator.hasNext(); }
@Override public ResultEstimationType numResultEstimation() { return iterator.numResultEstimation(); }
if(it.numResultEstimation()==ResultEstimationType.EXACT) { count = it.estimatedNumResults(); } else { count = 0; while(it.hasNext()) { it.next(); count++;
public void load(IteratorTripleID it, ProgressListener listener) { long number = it.estimatedNumResults(); int numTriples=0; while(it.hasNext()) { TripleID triple = it.next(); TripleOrderConvert.swapComponentOrder(triple, TripleComponentOrder.SPO, order);
@Override public Triple next() { TripleID triple = iterator.next(); Triple t = new Triple( nodeDictionary.getNode(triple.getSubject(), TripleComponentRole.SUBJECT), nodeDictionary.getNode(triple.getPredicate(), TripleComponentRole.PREDICATE), nodeDictionary.getNode(triple.getObject(), TripleComponentRole.OBJECT) ); return t; }
private void doFetchPrevious() { hasPreviousTriples = false; while(iterator.hasPrevious()){ TripleID previous = iterator.previous(); if(previous.match(pattern)) { hasPreviousTriples = true; hasMoreTriples = true; previousTriple.assign(previous); break; } } }
@Override public void goToStart() { iterator.goToStart(); }
@Override public void remove() { iterator.remove(); }
@Override public TripleComponentOrder getOrder() { return iterator.getOrder(); }
@Override public TripleString next() { TripleID triple = iterator.next(); // convert the tripleID to TripleString if(s.length()!=0) { lastSstr = s; } else if(triple.getSubject()!=lastSid) { lastSid = triple.getSubject(); lastSstr = dictionary.idToString(lastSid, TripleComponentRole.SUBJECT); } if(p.length()!=0) { lastPstr = p; } else if(triple.getPredicate()!=lastPid) { lastPstr = dictionary.idToString(triple.getPredicate(), TripleComponentRole.PREDICATE); lastPid = triple.getPredicate(); } if(o.length()!=0) { lastOstr = o; } else if(triple.getObject()!=lastOid) { lastOstr = dictionary.idToString(triple.getObject(), TripleComponentRole.OBJECT); lastOid = triple.getObject(); } return new TripleString(lastSstr, lastPstr, lastOstr); // return DictionaryUtil.tripleIDtoTripleString(dictionary, triple); }
@Override public void goToStart() { iterator.goToStart(); doFetchNext(); }
@Override public void remove() { iterator.remove(); }
private void fetchBlock() { reset(); int [] arrSubjects = new int[blockSize]; int [] arrPredicates = new int[blockSize]; int [] arrObjects = new int[blockSize]; int count=0; for(int i=0;i<blockSize && iterator.hasNext();i++) { TripleID t = new TripleID(iterator.next()); triples.add(t); if(s.length()==0) arrSubjects[count] = t.getSubject(); if(p.length()==0) arrPredicates[count] = t.getPredicate(); if(o.length()==0) arrObjects[count] = t.getObject(); count++; } if(s.length()==0) fill(arrSubjects, count, mapSubject, TripleComponentRole.SUBJECT); if(p.length()==0) fill(arrPredicates, count, mapPredicate, TripleComponentRole.PREDICATE); if(o.length()==0) fill(arrObjects, count, mapObject, TripleComponentRole.OBJECT); this.child = triples.iterator(); }
@Override public long estimatedNumResults() { return iterator.estimatedNumResults(); }
@Override public boolean hasNext() { return iterator.hasNext(); }
@Override public ResultEstimationType numResultEstimation() { return iterator.numResultEstimation(); }
@Override public void goToStart() { iterator.goToStart(); this.reset(); }