Class WrapperIndividualContentIndexBuilder<C,U>
java.lang.Object
es.uam.eps.ir.relison.content.index.AbstractIndexBuilder<C>
es.uam.eps.ir.relison.content.index.individual.AbstractIndividualContentIndexBuilder<C,U>
es.uam.eps.ir.relison.content.index.individual.WrapperIndividualContentIndexBuilder<C,U>
- Type Parameters:
C- type of the contents.U- type of the users.
- All Implemented Interfaces:
IndexBuilder<C>,IndividualContentIndexBuilder<C,U>
public class WrapperIndividualContentIndexBuilder<C,U> extends AbstractIndividualContentIndexBuilder<C,U>
Individual content index builder wrapping a simple one.
-
Field Summary
Fields Modifier and Type Field Description private AbstractIndexBuilder<C>builderA builder.private it.unimi.dsi.fastutil.ints.Int2ObjectMap<U>userMapMap storing the relation between contents and users. -
Constructor Summary
Constructors Constructor Description WrapperIndividualContentIndexBuilder(AbstractIndexBuilder<C> builder)Constructor. -
Method Summary
Modifier and Type Method Description voidclose(java.lang.String indexPath)Closes the builder.Index<C>getCoreIndex()Obtains the generated index.protected IndividualContentIndex<C,U>getCoreIndividualIndex()Obtains the generated index.intindexText(java.lang.String content, C contentId)Writes the contents of a user in the index.voidindexText(java.lang.String content, C contentId, U userId)Writes the contents of a user in the index.voidinit(java.lang.String indexPath)Initializes the builder.Methods inherited from class es.uam.eps.ir.relison.content.index.individual.AbstractIndividualContentIndexBuilder
saveUserContentMapMethods inherited from class es.uam.eps.ir.relison.content.index.AbstractIndexBuilder
clear, saveContentMap
-
Field Details
-
Constructor Details
-
WrapperIndividualContentIndexBuilder
Constructor.- Parameters:
builder- an index builder.
-
-
Method Details
-
getCoreIndex
Description copied from class:AbstractIndexBuilderObtains the generated index.- Specified by:
getCoreIndexin classAbstractIndexBuilder<C>- Returns:
- the generated index.
- Throws:
java.io.IOException- if something fails while creating such index.
-
getCoreIndividualIndex
Description copied from class:AbstractIndividualContentIndexBuilderObtains the generated index.- Specified by:
getCoreIndividualIndexin classAbstractIndividualContentIndexBuilder<C,U>- Returns:
- the generated index.
- Throws:
java.io.IOException- if something fails while creating such index.
-
indexText
Description copied from interface:IndividualContentIndexBuilderWrites the contents of a user in the index.- Parameters:
content- the published content.contentId- the identifier of the content.userId- the identifier of the author of the content.- Throws:
java.io.IOException- if something fails while writing the contents.
-
init
public void init(java.lang.String indexPath) throws java.io.IOExceptionDescription copied from interface:IndexBuilderInitializes the builder.- Parameters:
indexPath- path containing the index.- Throws:
java.io.IOException- if something fails while initializing the index.
-
indexText
Description copied from interface:IndexBuilderWrites the contents of a user in the index.- Parameters:
content- the published content.contentId- the user.- Returns:
- the identifier of the new document.
- Throws:
java.io.IOException- if something fails while writing the contents.
-
close
public void close(java.lang.String indexPath) throws java.io.IOExceptionDescription copied from interface:IndexBuilderCloses the builder.- Parameters:
indexPath- path containing the index.- Throws:
java.io.IOException- if something fails while closing the index.
-