/** * Creates a new hash map copying a given one. * * @param m * a {@link Map} to be copied into the new hash map. * @param f * the load factor. */ public Int2IntOpenHashMap(final Map<? extends Integer, ? extends Integer> m, final float f) { this(m.size(), f); putAll(m); } /**
/** * Creates a new hash map copying a given type-specific one. * * @param m * a type-specific map to be copied into the new hash map. * @param f * the load factor. */ public Int2IntOpenHashMap(final Int2IntMap m, final float f) { this(m.size(), f); putAll(m); } /**
/** * Get the whole model * * @return the whole model */ public Int2IntOpenHashMap[] getModel() { synchronized (this) { if (model == null) { model = new Int2IntOpenHashMap[row]; for (Map.Entry<Integer, Map<Integer, Int2IntOpenHashMap>> rowEntry : tempModel .entrySet()) { int size = 0; for (Map.Entry<Integer, Int2IntOpenHashMap> partEntry : rowEntry.getValue() .entrySet()) { size += partEntry.getValue().size(); } model[rowEntry.getKey()] = new Int2IntOpenHashMap(size); for (Map.Entry<Integer, Int2IntOpenHashMap> partEntry : rowEntry.getValue() .entrySet()) { model[rowEntry.getKey()].putAll(partEntry.getValue()); } } } return model; } } }