转眼进入12月了,细看项目进展,满眼都是泪,没文化真可怕,还是要加油了。
1.抛异常使用throw时,不是非要将throw写在开头函数末尾,可以写在执行语句之后,比如这样:
if (queryExecutionIter == null) throw new NoSuchElementException(this.getClass() + ".next") ;
2.在这个语句中可以看到返回了关键的东西:
QuerySolution soln = response.nextSolution();
跟踪可见,该语句的关键算法是在QueryIteratorBase这个类中实现的,官方对这个类的解释是:
This class provides the general machinary for iterators. This includes:
<ul>
<li>autoclose when the iterator runs out</li>
<li>ensuring query iterators only contain Bindings</li>
</ul>
实际上,这个类中的slot就是结果,问题是,什么时候查询出来的?