Class NgramsForOrderMapWrapper<W,​V>

  • Type Parameters:
    W -
    V -
    All Implemented Interfaces:
    java.util.Map<java.util.List<W>,​V>

    public class NgramsForOrderMapWrapper<W,​V>
    extends java.util.AbstractMap<java.util.List<W>,​V>
    Wraps an NgramMap as a Java Map, but only ngrams of a particular order. This collection is read-only. It is also uses a lot inefficient boxing and unboxing.
    Author:
    adampauls
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean containsKey​(java.lang.Object key)  
      java.util.Set<java.util.Map.Entry<java.util.List<W>,​V>> entrySet()  
      V get​(java.lang.Object arg0)  
      • Methods inherited from class java.util.AbstractMap

        clear, clone, containsValue, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, values
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
    • Constructor Detail

      • NgramsForOrderMapWrapper

        public NgramsForOrderMapWrapper​(NgramMap<V> map,
                                        WordIndexer<W> wordIndexer,
                                        int ngramOrder)
        Parameters:
        map -
        ngramOrder - 0-based, i.e. 0 means unigrams
    • Method Detail

      • get

        public V get​(java.lang.Object arg0)
        Specified by:
        get in interface java.util.Map<W,​V>
        Overrides:
        get in class java.util.AbstractMap<java.util.List<W>,​V>
      • containsKey

        public boolean containsKey​(java.lang.Object key)
        Specified by:
        containsKey in interface java.util.Map<W,​V>
        Overrides:
        containsKey in class java.util.AbstractMap<java.util.List<W>,​V>
      • entrySet

        public java.util.Set<java.util.Map.Entry<java.util.List<W>,​V>> entrySet()
        Specified by:
        entrySet in interface java.util.Map<W,​V>
        Specified by:
        entrySet in class java.util.AbstractMap<java.util.List<W>,​V>