/** * @return An unmodifiable view of the reverse-lookup index map for the elements of * {@link #getDecorated() the decorated <code>List</code>}. */ public Object2IntMap<E> getReverseLookupMap() { return Object2IntMaps.unmodifiable(reverseLookupMap); }
/** * Returns a hash code for this map. * * The hash code of a map is computed by summing the hash codes of its entries. * * @return a hash code for this map. */ @Override public int hashCode() { int h = 0, n = size(); final ObjectIterator<Object2IntMap.Entry<K>> i = Object2IntMaps.fastIterator(this); while (n-- != 0) h += i.next().hashCode(); return h; } @Override
public FidelDecoderWrapper(IntegerLanguageModel languageModel, DecoderWeights weights) { this.languageModel = languageModel; this.srcWordMap = Object2IntMaps.synchronize(new Object2IntOpenHashMap<String>()); this.srcInvMap = Int2ObjectMaps.synchronize(new Int2ObjectOpenHashMap<String>()); this.trgWordMap = languageModel.wordMap(); this.invWordMap = languageModel.invWordMap(); this.weights = weights; }
this.coverages = unmodifiableList( readQueryCoveragesFile( coveragesFile, charset ) ); this.libraryNums = Object2IntMaps.unmodifiable( invertList( libraries ) ); this.coverageNums = Object2IntMaps.unmodifiable( invertList( coverages ) );
@Override public String toString() { final StringBuilder s = new StringBuilder(); final ObjectIterator<Object2IntMap.Entry<K>> i = Object2IntMaps.fastIterator(this); int n = size(); Object2IntMap.Entry<K> e; boolean first = true; s.append("{"); while (n-- != 0) { if (first) first = false; else s.append(", "); e = i.next(); if (this == e.getKey()) s.append("(this map)"); else s.append(String.valueOf(e.getKey())); s.append("=>"); s.append(String.valueOf(e.getIntValue())); } s.append("}"); return s.toString(); } }
this.coverages = unmodifiableList( readRenderCoveragesFile( coveragesFile, charset ) ); this.libraryNums = Object2IntMaps.unmodifiable( invertList( libraries ) ); this.coverageNums = Object2IntMaps.unmodifiable( invertList( coverages ) );
/** {@inheritDoc} */ @SuppressWarnings({"unchecked", "deprecation"}) @Override public void putAll(final Map<? extends K, ? extends Integer> m) { if (m instanceof Object2IntMap) { ObjectIterator<Object2IntMap.Entry<K>> i = Object2IntMaps.fastIterator((Object2IntMap<K>) m); while (i.hasNext()) { final Object2IntMap.Entry<? extends K> e = i.next(); put(e.getKey(), e.getIntValue()); } } else { int n = m.size(); final Iterator<? extends Map.Entry<? extends K, ? extends Integer>> i = m.entrySet().iterator(); Map.Entry<? extends K, ? extends Integer> e; while (n-- != 0) { e = i.next(); put(e.getKey(), e.getValue()); } } } /**
public QueryDatabase( File flatDir, DncProjection proj, ExecutorService exec ) throws IOException { this.flatDir = flatDir; this.proj = proj; this.exec = exec; this.charset = readFlatCharset( flatDir ); this.fcodeNames = Int2ObjectMaps.unmodifiable( readFlatFcodeNames( flatDir, charset ) ); this.attrNames = Int2ObjectMaps.unmodifiable( readFlatAttrNames( flatDir, charset ) ); this.flatLibraryNums = Object2IntMaps.unmodifiable( invertIdsMap( readFlatLibraryNames( flatDir, charset ) ) ); this.flatCoverageNums = Object2IntMaps.unmodifiable( invertIdsMap( readFlatCoverageNames( flatDir, charset ) ) ); this.bufMutex = new Object( ); this.featuresBufMasters = unmodifiableMap( readFlatChunks( flatDir ) ); this.ringsBufMaster = memmapFlatRingsBuf( flatDir ); this.verticesBufMaster = memmapFlatVerticesBuf( flatDir ); this.attrsBufMaster = memmapFlatAttrsBuf( flatDir ); this.stringsBufMaster = memmapFlatStringsBuf( flatDir ); }
public TransitionalDatabase( File flatDir, DncProjection proj, ListMultimap<String,DncGeosymAssignment> geosymAssignments, Function<String,Object> externalAttrs ) throws IOException { this.flatDir = flatDir; this.proj = proj; this.geosymAssignments = geosymAssignments; this.externalAttrs = externalAttrs; this.charset = readFlatCharset( flatDir ); this.fcodeNames = Int2ObjectMaps.unmodifiable( readFlatFcodeNames( flatDir, charset ) ); this.attrNames = Int2ObjectMaps.unmodifiable( readFlatAttrNames( flatDir, charset ) ); this.flatLibraryNums = Object2IntMaps.unmodifiable( invertIdsMap( readFlatLibraryNames( flatDir, charset ) ) ); this.flatCoverageNums = Object2IntMaps.unmodifiable( invertIdsMap( readFlatCoverageNames( flatDir, charset ) ) ); this.bufMutex = new Object( ); this.featuresBufMasters = unmodifiableMap( readFlatChunks( flatDir ) ); this.ringsBufMaster = memmapFlatRingsBuf( flatDir ); this.verticesBufMaster = memmapFlatVerticesBuf( flatDir ); this.attrsBufMaster = memmapFlatAttrsBuf( flatDir ); this.stringsBufMaster = memmapFlatStringsBuf( flatDir ); }