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 Details

    • builder

      private final AbstractIndexBuilder<C> builder
      A builder.
    • userMap

      private final it.unimi.dsi.fastutil.ints.Int2ObjectMap<U> userMap
      Map storing the relation between contents and users.
  • Constructor Details

  • Method Details

    • getCoreIndex

      public Index<C> getCoreIndex() throws java.io.IOException
      Description copied from class: AbstractIndexBuilder
      Obtains the generated index.
      Specified by:
      getCoreIndex in class AbstractIndexBuilder<C>
      Returns:
      the generated index.
      Throws:
      java.io.IOException - if something fails while creating such index.
    • getCoreIndividualIndex

      protected IndividualContentIndex<C,​U> getCoreIndividualIndex() throws java.io.IOException
      Description copied from class: AbstractIndividualContentIndexBuilder
      Obtains the generated index.
      Specified by:
      getCoreIndividualIndex in class AbstractIndividualContentIndexBuilder<C,​U>
      Returns:
      the generated index.
      Throws:
      java.io.IOException - if something fails while creating such index.
    • indexText

      public void indexText​(java.lang.String content, C contentId, U userId) throws java.io.IOException
      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.IOException
      Description 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

      public int indexText​(java.lang.String content, C contentId) throws java.io.IOException
      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.IOException
      Description copied from interface: IndexBuilder
      Closes the builder.
      Parameters:
      indexPath - path containing the index.
      Throws:
      java.io.IOException - if something fails while closing the index.