Class RandomStream
- java.lang.Object
-
- com.complexible.common.rdf.random.RandomStream
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRandomStream.Factory
-
Constructor Summary
Constructors Constructor Description RandomStream(long seed, long cnt)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longbytesRead()Supposed to return the number currently parsed.voidclose()longestimatedCount()Estimated size of statements.ResourcegetContext()Returns the default context associated with this stream ornullif there is no default context.java.lang.StringgetName()Returns the name of this stream.booleanhasContext()Returnstrueeither if this stream has a non-nullcontextor the statements generated by this stream has contexts.longlength()voidparse(RDFHandler handler)Parses the stream and passes the statements to the given handler.
-
-
-
Method Detail
-
parse
public void parse(RDFHandler handler)
Description copied from interface:RDFStreamParses the stream and passes the statements to the given handler.
-
getContext
public Resource getContext()
Description copied from interface:RDFStreamReturns the default context associated with this stream ornullif there is no default context. Note that, the statements that will be sent to the handler may not be using this context and the user of this stream should make sure the context information is used correctly.- Specified by:
getContextin interfaceRDFStream
-
hasContext
public boolean hasContext()
Description copied from interface:RDFStreamReturnstrueeither if this stream has a non-nullcontextor the statements generated by this stream has contexts.- Specified by:
hasContextin interfaceRDFStream
-
getName
public java.lang.String getName()
Description copied from interface:RDFStreamReturns the name of this stream. If the stream is backed by a file this will return the file's name. Otherwise it might be an auto-generated name or some other (not necessarily unique) name.
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
bytesRead
public long bytesRead()
Description copied from interface:RDFStreamSupposed to return the number currently parsed. Can be used for progress reporting from RDFHandler
-
length
public long length()
-
estimatedCount
public long estimatedCount()
Description copied from interface:RDFStreamEstimated size of statements. Might be accurate or calculate only from the data size. Given N bytes in an RDFStream, the estimated number of statements depends on the RDF format. RDF stream may or may not be compressed, which also impacts the bytes-to-statements ratio.- Specified by:
estimatedCountin interfaceRDFStream- Returns:
- estimated size of statements.
-
-