Class ImplFreqVector

java.lang.Object
es.uam.eps.ir.relison.content.index.freq.impl.ImplFreqVector
All Implemented Interfaces:
FreqVector, java.lang.Iterable<TermFreq>

public class ImplFreqVector
extends java.lang.Object
implements FreqVector
Implementation of a frequency vector
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<java.lang.String> vector
    The frequencies for the different terms.
  • Constructor Summary

    Constructors 
    Constructor Description
    ImplFreqVector​(java.lang.String text)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    long getFreq​(java.lang.String term)
    The frequency of the term in the vector.
    java.util.Iterator<TermFreq> iterator()  
    long size()
    The number of terms in the vector.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Field Details

    • vector

      private final it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<java.lang.String> vector
      The frequencies for the different terms.
  • Constructor Details

    • ImplFreqVector

      public ImplFreqVector​(java.lang.String text)
      Constructor. Builds a frequency vector from text.
      Parameters:
      text - the text.
  • Method Details

    • size

      public long size()
      Description copied from interface: FreqVector
      The number of terms in the vector.
      Specified by:
      size in interface FreqVector
      Returns:
      the number of terms in the vector.
    • getFreq

      public long getFreq​(java.lang.String term)
      Description copied from interface: FreqVector
      The frequency of the term in the vector.
      Specified by:
      getFreq in interface FreqVector
      Parameters:
      term - the term.
      Returns:
      the frequency of the term in the vector.
    • iterator

      public java.util.Iterator<TermFreq> iterator()
      Specified by:
      iterator in interface java.lang.Iterable<TermFreq>