line = this.reader.readLine();
//Once EOF has been reached we'll see null for this call so we can return false because there are no further bindings
if (line == null) return false;
}
catch (IOException e)
{ throw new QueryException("Error parsing TSV results - " + e.getMessage()); }
if ( line.isEmpty() )
{
// Empty input line - no bindings.
// Only valid when we expect zero/one values as otherwise we should get a sequence of tab characters
// which means a non-empty string which we handle normally
if (expectedItems > 1) throw new QueryException(String.format("Error Parsing TSV results - A result row had 0/1 values when %d were expected", expectedItems));
this.binding = BindingFactory.create() ;
return true ;
}
String[] tokens = TSVInput.pattern.split(line, -1);
if (tokens.length != expectedItems)
throw new QueryException(String.format("Error Parsing TSV results - A result row had %d values instead of the expected %d.", tokens.length, expectedItems));
this.binding = BindingFactory.create();
for ( int i = 0; i < tokens.length; i++ )
{