public class CSVTable
extends com.hp.hpl.jena.sparql.algebra.table.TableBase
implements com.hp.hpl.jena.sparql.algebra.Table
Table
interface over a CSV file.
Supports opening multiple iterators over the input, which
will lead to multiple passes over the input CSV file.
Connects to the input as lazily as possible, while still
supporting the entire Table interface including size()
.Modifier and Type | Field and Description |
---|---|
private java.lang.Boolean |
isEmptyCache |
private com.hp.hpl.jena.util.iterator.ClosableIterator<com.hp.hpl.jena.sparql.engine.binding.Binding> |
nextParser |
private java.util.List<com.hp.hpl.jena.util.iterator.ClosableIterator<com.hp.hpl.jena.sparql.engine.binding.Binding>> |
openIterators |
private CSVOptions |
options |
private java.lang.Integer |
sizeCache |
private InputStreamSource |
source |
private java.util.List<com.hp.hpl.jena.sparql.core.Var> |
varsCache |
Constructor and Description |
---|
CSVTable(InputStreamSource source) |
CSVTable(InputStreamSource source,
CSVOptions options) |
Modifier and Type | Method and Description |
---|---|
void |
closeTable()
Closes any open iterators over the table.
|
private CSVParser |
createParser() |
private void |
ensureHasParser() |
java.util.List<java.lang.String> |
getVarNames() |
java.util.List<com.hp.hpl.jena.sparql.core.Var> |
getVars() |
boolean |
isEmpty()
Returns
true if the table has zero rows. |
com.hp.hpl.jena.sparql.engine.QueryIterator |
iterator(com.hp.hpl.jena.sparql.engine.ExecutionContext ctxt) |
com.hp.hpl.jena.util.iterator.ClosableIterator<com.hp.hpl.jena.sparql.engine.binding.Binding> |
rows() |
int |
size()
Returns the number of rows in the table.
|
addBinding, close, contains, equals, eval, hashCode, toResultSet, toString
private final InputStreamSource source
private final CSVOptions options
private final java.util.List<com.hp.hpl.jena.util.iterator.ClosableIterator<com.hp.hpl.jena.sparql.engine.binding.Binding>> openIterators
private com.hp.hpl.jena.util.iterator.ClosableIterator<com.hp.hpl.jena.sparql.engine.binding.Binding> nextParser
private java.util.List<com.hp.hpl.jena.sparql.core.Var> varsCache
private java.lang.Boolean isEmptyCache
private java.lang.Integer sizeCache
public CSVTable(InputStreamSource source)
public CSVTable(InputStreamSource source, CSVOptions options)
public com.hp.hpl.jena.sparql.engine.QueryIterator iterator(com.hp.hpl.jena.sparql.engine.ExecutionContext ctxt)
iterator
in interface com.hp.hpl.jena.sparql.algebra.Table
public com.hp.hpl.jena.util.iterator.ClosableIterator<com.hp.hpl.jena.sparql.engine.binding.Binding> rows()
rows
in interface com.hp.hpl.jena.sparql.algebra.Table
public java.util.List<com.hp.hpl.jena.sparql.core.Var> getVars()
getVars
in interface com.hp.hpl.jena.sparql.algebra.Table
public java.util.List<java.lang.String> getVarNames()
getVarNames
in interface com.hp.hpl.jena.sparql.algebra.Table
public boolean isEmpty()
true
if the table has zero rows.
Is fast.isEmpty
in interface com.hp.hpl.jena.sparql.algebra.Table
isEmpty
in class com.hp.hpl.jena.sparql.algebra.table.TableBase
public int size()
size
in interface com.hp.hpl.jena.sparql.algebra.Table
size
in class com.hp.hpl.jena.sparql.algebra.table.TableBase
public void closeTable()
closeTable
in class com.hp.hpl.jena.sparql.algebra.table.TableBase
private void ensureHasParser()
private CSVParser createParser()