edu.berkeley.nlp.lm.map
Class NgramsForOrderMapWrapper<W,V>

java.lang.Object
  extended by java.util.AbstractMap<List<W>,V>
      extended by edu.berkeley.nlp.lm.map.NgramsForOrderMapWrapper<W,V>
Type Parameters:
W -
V -
All Implemented Interfaces:
Map<List<W>,V>

public class NgramsForOrderMapWrapper<W,V>
extends AbstractMap<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
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
NgramsForOrderMapWrapper(NgramMap<V> map, WordIndexer<W> wordIndexer, int ngramOrder)
           
 
Method Summary
 boolean containsKey(Object key)
           
 Set<Map.Entry<List<W>,V>> entrySet()
           
 V get(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
 

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(Object arg0)
Specified by:
get in interface Map<List<W>,V>
Overrides:
get in class AbstractMap<List<W>,V>

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map<List<W>,V>
Overrides:
containsKey in class AbstractMap<List<W>,V>

entrySet

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