On 02/02/16 19:29, Paul Houle wrote:
Carlo,  Andy,

I like the Iterator<> interfaces in the Jena framework for getting
data out,  but I make a habit of always putting results in a List  or
Queue or something before putting them back into the same Jena model
because i get less BS per mile that way in terms of Exceptions and
other exceptional events.

Does Jena have an official policy on being reenterable in that way?

Paul - iterators are "normal". Many do not support .remove

Like any Java iterators - do not modify the underlying data structure
while iterating. CCE will result - or wrong answers.

Either copy to a list, or note work to be done and do after the iterator
is no longer needed. Standard java idioms. List<> is good if you can afford the space.

Beware that ArrayList<> has peculiar growth characteristics for large sizes.

See Iter - like Java8 Stream but for iterators.

        Andy

Reply via email to