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>
builder
A builder.private it.unimi.dsi.fastutil.ints.Int2ObjectMap<U>
userMap
Map storing the relation between contents and users. -
Constructor Summary
Constructors Constructor Description WrapperIndividualContentIndexBuilder(AbstractIndexBuilder<C> builder)
Constructor. -
Method Summary
Modifier and Type Method Description void
close(java.lang.String indexPath)
Closes the builder.Index<C>
getCoreIndex()
Obtains the generated index.protected IndividualContentIndex<C,U>
getCoreIndividualIndex()
Obtains the generated index.int
indexText(java.lang.String content, C contentId)
Writes the contents of a user in the index.void
indexText(java.lang.String content, C contentId, U userId)
Writes the contents of a user in the index.void
init(java.lang.String indexPath)
Initializes the builder.Methods inherited from class es.uam.eps.ir.relison.content.index.individual.AbstractIndividualContentIndexBuilder
saveUserContentMap
Methods 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:AbstractIndexBuilder
Obtains the generated index.- Specified by:
getCoreIndex
in classAbstractIndexBuilder<C>
- Returns:
- the generated index.
- Throws:
java.io.IOException
- if something fails while creating such index.
-
getCoreIndividualIndex
Description copied from class:AbstractIndividualContentIndexBuilder
Obtains the generated index.- Specified by:
getCoreIndividualIndex
in classAbstractIndividualContentIndexBuilder<C,U>
- Returns:
- the generated index.
- Throws:
java.io.IOException
- if something fails while creating such index.
-
indexText
Description copied from interface:IndividualContentIndexBuilder
Writes 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:IndexBuilder
Initializes the builder.- Parameters:
indexPath
- path containing the index.- Throws:
java.io.IOException
- if something fails while initializing the index.
-
indexText
Description copied from interface:IndexBuilder
Writes 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:IndexBuilder
Closes the builder.- Parameters:
indexPath
- path containing the index.- Throws:
java.io.IOException
- if something fails while closing the index.
-