this.tripleBuffer.addLast(t);
}
@Override
public void consumeDebug(final Triple triple, final DebugStep debugstep) {
final TimestampedTriple t = new TimestampedTriple(triple, (new Date()).getTime());
if(isMatchingTypeTriple(t)) {
super.consumeDebug(t, debugstep);
// search for triples with same subject to consume
for(Triple tmp : this.tripleBuffer) {
if(haveSameSubject(tmp,t)) {
super.consumeDebug(tmp, debugstep);
}
}
// add type triple to extra buffer
this.typeTripleBuffer.addLast(t);
} else {
// consume triple if a type-triple with same subject exists
for(Triple tmp : this.typeTripleBuffer) {
if(haveSameSubject(tmp,t)) {
super.consumeDebug(t, debugstep);
break;
}
}
}
this.tripleBuffer.addLast(t);
// remove all instances where the type-triple is too old
long now = t.getTimestamp();
int index = 0;
for(TimestampedTriple tmp : this.typeTripleBuffer) {
if (now - tmp.getTimestamp() >= this.duration) {
deleteInstanceDebug(tmp, debugstep);
index++;