Package it.unimi.di.big.mg4j.tool
Interface VirtualDocumentResolver
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
URLMPHVirtualDocumentResolver
public interface VirtualDocumentResolver extends Serializable
A resolver for virtual documents.Fields of virtual type return a list of virtual document fragments containing a document specification (e.g., its URI) and the virtual text associated with the document. Since there are many ways of defining the virtual document,
Scanrequires a virtual-document resolver for each virtual field: the resolver takes in the string defining a document, and returns a document number. SeeURLMPHVirtualDocumentResolverfor a natural example.
-
-
Method Summary
Modifier and Type Method Description voidcontext(Document document)Sets the context document.longnumberOfDocuments()Returns the number of documents handled by this resolver, if it is known.longresolve(CharSequence virtualDocumentSpec)Resolves a virtual document specification.
-
-
-
Method Detail
-
context
void context(Document document)
Sets the context document. All successive calls toresolve(CharSequence)will assume the virtual-document specification was found indocument.- Parameters:
document- the context document.
-
resolve
long resolve(CharSequence virtualDocumentSpec)
Resolves a virtual document specification.Note that the resolution process is carried out in the context of the last document passed to
context(Document)(e.g., for relative URI resolution). Ifcontext(Document)was never called, the behaviour is undefined.- Parameters:
virtualDocumentSpec- the virtual document specification.- Returns:
- the document
virtualDocumentSpecrefers to, or -1 if the specification could not be resolved.
-
numberOfDocuments
long numberOfDocuments()
Returns the number of documents handled by this resolver, if it is known. A call toresolve(CharSequence)will always return a number smaller than the one returned by this method.- Returns:
- the number of documents handled by this resolver.
-
-