Tabnine Logo
HashMap.constructorPut
Code IndexAdd Tabnine to your IDE (free)

How to use
constructorPut
method
in
java.util.HashMap

Best Java code snippets using java.util.HashMap.constructorPut (Showing top 15 results out of 315)

origin: robovm/robovm

/**
 * Inserts all of the elements of map into this HashMap in a manner
 * suitable for use by constructors and pseudo-constructors (i.e., clone,
 * readObject). Also used by LinkedHashMap.
 */
final void constructorPutAll(Map<? extends K, ? extends V> map) {
  if (table == EMPTY_TABLE) {
    doubleCapacity(); // Don't do unchecked puts to a shared table.
  }
  for (Entry<? extends K, ? extends V> e : map.entrySet()) {
    constructorPut(e.getKey(), e.getValue());
  }
}
origin: robovm/robovm

  private void readObject(ObjectInputStream stream) throws IOException,
      ClassNotFoundException {
    stream.defaultReadObject();
    int capacity = stream.readInt();
    if (capacity < 0) {
      throw new InvalidObjectException("Capacity: " + capacity);
    }
    if (capacity < MINIMUM_CAPACITY) {
      capacity = MINIMUM_CAPACITY;
    } else if (capacity > MAXIMUM_CAPACITY) {
      capacity = MAXIMUM_CAPACITY;
    } else {
      capacity = Collections.roundUpToPowerOfTwo(capacity);
    }
    makeTable(capacity);

    int size = stream.readInt();
    if (size < 0) {
      throw new InvalidObjectException("Size: " + size);
    }

    init(); // Give subclass (LinkedHashMap) a chance to initialize itself
    for (int i = 0; i < size; i++) {
      @SuppressWarnings("unchecked") K key = (K) stream.readObject();
      @SuppressWarnings("unchecked") V val = (V) stream.readObject();
      constructorPut(key, val);
    }
  }
}
origin: ibinti/bugvm

/**
 * Inserts all of the elements of map into this HashMap in a manner
 * suitable for use by constructors and pseudo-constructors (i.e., clone,
 * readObject). Also used by LinkedHashMap.
 */
final void constructorPutAll(Map<? extends K, ? extends V> map) {
  if (table == EMPTY_TABLE) {
    doubleCapacity(); // Don't do unchecked puts to a shared table.
  }
  for (Entry<? extends K, ? extends V> e : map.entrySet()) {
    constructorPut(e.getKey(), e.getValue());
  }
}
origin: MobiVM/robovm

/**
 * Inserts all of the elements of map into this HashMap in a manner
 * suitable for use by constructors and pseudo-constructors (i.e., clone,
 * readObject). Also used by LinkedHashMap.
 */
final void constructorPutAll(Map<? extends K, ? extends V> map) {
  if (table == EMPTY_TABLE) {
    doubleCapacity(); // Don't do unchecked puts to a shared table.
  }
  for (Entry<? extends K, ? extends V> e : map.entrySet()) {
    constructorPut(e.getKey(), e.getValue());
  }
}
origin: com.gluonhq/robovm-rt

/**
 * Inserts all of the elements of map into this HashMap in a manner
 * suitable for use by constructors and pseudo-constructors (i.e., clone,
 * readObject). Also used by LinkedHashMap.
 */
final void constructorPutAll(Map<? extends K, ? extends V> map) {
  if (table == EMPTY_TABLE) {
    doubleCapacity(); // Don't do unchecked puts to a shared table.
  }
  for (Entry<? extends K, ? extends V> e : map.entrySet()) {
    constructorPut(e.getKey(), e.getValue());
  }
}
origin: FlexoVM/flexovm

/**
 * Inserts all of the elements of map into this HashMap in a manner
 * suitable for use by constructors and pseudo-constructors (i.e., clone,
 * readObject). Also used by LinkedHashMap.
 */
final void constructorPutAll(Map<? extends K, ? extends V> map) {
  if (table == EMPTY_TABLE) {
    doubleCapacity(); // Don't do unchecked puts to a shared table.
  }
  for (Entry<? extends K, ? extends V> e : map.entrySet()) {
    constructorPut(e.getKey(), e.getValue());
  }
}
origin: com.mobidevelop.robovm/robovm-rt

/**
 * Inserts all of the elements of map into this HashMap in a manner
 * suitable for use by constructors and pseudo-constructors (i.e., clone,
 * readObject). Also used by LinkedHashMap.
 */
final void constructorPutAll(Map<? extends K, ? extends V> map) {
  if (table == EMPTY_TABLE) {
    doubleCapacity(); // Don't do unchecked puts to a shared table.
  }
  for (Entry<? extends K, ? extends V> e : map.entrySet()) {
    constructorPut(e.getKey(), e.getValue());
  }
}
origin: com.bugvm/bugvm-rt

/**
 * Inserts all of the elements of map into this HashMap in a manner
 * suitable for use by constructors and pseudo-constructors (i.e., clone,
 * readObject). Also used by LinkedHashMap.
 */
final void constructorPutAll(Map<? extends K, ? extends V> map) {
  if (table == EMPTY_TABLE) {
    doubleCapacity(); // Don't do unchecked puts to a shared table.
  }
  for (Entry<? extends K, ? extends V> e : map.entrySet()) {
    constructorPut(e.getKey(), e.getValue());
  }
}
origin: com.jtransc/jtransc-rt

/**
 * Inserts all of the elements of map into this HashMap in a manner
 * suitable for use by constructors and pseudo-constructors (i.e., clone,
 * readObject). Also used by LinkedHashMap.
 */
final void constructorPutAll(Map<? extends K, ? extends V> map) {
  if (table == EMPTY_TABLE) {
    doubleCapacity(); // Don't do unchecked puts to a shared table.
  }
  for (Entry<? extends K, ? extends V> e : map.entrySet()) {
    constructorPut(e.getKey(), e.getValue());
  }
}
origin: ibinti/bugvm

  private void readObject(ObjectInputStream stream) throws IOException,
      ClassNotFoundException {
    stream.defaultReadObject();
    int capacity = stream.readInt();
    if (capacity < 0) {
      throw new InvalidObjectException("Capacity: " + capacity);
    }
    if (capacity < MINIMUM_CAPACITY) {
      capacity = MINIMUM_CAPACITY;
    } else if (capacity > MAXIMUM_CAPACITY) {
      capacity = MAXIMUM_CAPACITY;
    } else {
      capacity = Collections.roundUpToPowerOfTwo(capacity);
    }
    makeTable(capacity);

    int size = stream.readInt();
    if (size < 0) {
      throw new InvalidObjectException("Size: " + size);
    }

    init(); // Give subclass (LinkedHashMap) a chance to initialize itself
    for (int i = 0; i < size; i++) {
      @SuppressWarnings("unchecked") K key = (K) stream.readObject();
      @SuppressWarnings("unchecked") V val = (V) stream.readObject();
      constructorPut(key, val);
    }
  }
}
origin: MobiVM/robovm

  private void readObject(ObjectInputStream stream) throws IOException,
      ClassNotFoundException {
    stream.defaultReadObject();
    int capacity = stream.readInt();
    if (capacity < 0) {
      throw new InvalidObjectException("Capacity: " + capacity);
    }
    if (capacity < MINIMUM_CAPACITY) {
      capacity = MINIMUM_CAPACITY;
    } else if (capacity > MAXIMUM_CAPACITY) {
      capacity = MAXIMUM_CAPACITY;
    } else {
      capacity = Collections.roundUpToPowerOfTwo(capacity);
    }
    makeTable(capacity);

    int size = stream.readInt();
    if (size < 0) {
      throw new InvalidObjectException("Size: " + size);
    }

    init(); // Give subclass (LinkedHashMap) a chance to initialize itself
    for (int i = 0; i < size; i++) {
      @SuppressWarnings("unchecked") K key = (K) stream.readObject();
      @SuppressWarnings("unchecked") V val = (V) stream.readObject();
      constructorPut(key, val);
    }
  }
}
origin: com.mobidevelop.robovm/robovm-rt

  private void readObject(ObjectInputStream stream) throws IOException,
      ClassNotFoundException {
    stream.defaultReadObject();
    int capacity = stream.readInt();
    if (capacity < 0) {
      throw new InvalidObjectException("Capacity: " + capacity);
    }
    if (capacity < MINIMUM_CAPACITY) {
      capacity = MINIMUM_CAPACITY;
    } else if (capacity > MAXIMUM_CAPACITY) {
      capacity = MAXIMUM_CAPACITY;
    } else {
      capacity = Collections.roundUpToPowerOfTwo(capacity);
    }
    makeTable(capacity);

    int size = stream.readInt();
    if (size < 0) {
      throw new InvalidObjectException("Size: " + size);
    }

    init(); // Give subclass (LinkedHashMap) a chance to initialize itself
    for (int i = 0; i < size; i++) {
      @SuppressWarnings("unchecked") K key = (K) stream.readObject();
      @SuppressWarnings("unchecked") V val = (V) stream.readObject();
      constructorPut(key, val);
    }
  }
}
origin: com.gluonhq/robovm-rt

  private void readObject(ObjectInputStream stream) throws IOException,
      ClassNotFoundException {
    stream.defaultReadObject();
    int capacity = stream.readInt();
    if (capacity < 0) {
      throw new InvalidObjectException("Capacity: " + capacity);
    }
    if (capacity < MINIMUM_CAPACITY) {
      capacity = MINIMUM_CAPACITY;
    } else if (capacity > MAXIMUM_CAPACITY) {
      capacity = MAXIMUM_CAPACITY;
    } else {
      capacity = Collections.roundUpToPowerOfTwo(capacity);
    }
    makeTable(capacity);

    int size = stream.readInt();
    if (size < 0) {
      throw new InvalidObjectException("Size: " + size);
    }

    init(); // Give subclass (LinkedHashMap) a chance to initialize itself
    for (int i = 0; i < size; i++) {
      @SuppressWarnings("unchecked") K key = (K) stream.readObject();
      @SuppressWarnings("unchecked") V val = (V) stream.readObject();
      constructorPut(key, val);
    }
  }
}
origin: FlexoVM/flexovm

  private void readObject(ObjectInputStream stream) throws IOException,
      ClassNotFoundException {
    stream.defaultReadObject();
    int capacity = stream.readInt();
    if (capacity < 0) {
      throw new InvalidObjectException("Capacity: " + capacity);
    }
    if (capacity < MINIMUM_CAPACITY) {
      capacity = MINIMUM_CAPACITY;
    } else if (capacity > MAXIMUM_CAPACITY) {
      capacity = MAXIMUM_CAPACITY;
    } else {
      capacity = Collections.roundUpToPowerOfTwo(capacity);
    }
    makeTable(capacity);

    int size = stream.readInt();
    if (size < 0) {
      throw new InvalidObjectException("Size: " + size);
    }

    init(); // Give subclass (LinkedHashMap) a chance to initialize itself
    for (int i = 0; i < size; i++) {
      @SuppressWarnings("unchecked") K key = (K) stream.readObject();
      @SuppressWarnings("unchecked") V val = (V) stream.readObject();
      constructorPut(key, val);
    }
  }
}
origin: com.bugvm/bugvm-rt

  private void readObject(ObjectInputStream stream) throws IOException,
      ClassNotFoundException {
    stream.defaultReadObject();
    int capacity = stream.readInt();
    if (capacity < 0) {
      throw new InvalidObjectException("Capacity: " + capacity);
    }
    if (capacity < MINIMUM_CAPACITY) {
      capacity = MINIMUM_CAPACITY;
    } else if (capacity > MAXIMUM_CAPACITY) {
      capacity = MAXIMUM_CAPACITY;
    } else {
      capacity = Collections.roundUpToPowerOfTwo(capacity);
    }
    makeTable(capacity);

    int size = stream.readInt();
    if (size < 0) {
      throw new InvalidObjectException("Size: " + size);
    }

    init(); // Give subclass (LinkedHashMap) a chance to initialize itself
    for (int i = 0; i < size; i++) {
      @SuppressWarnings("unchecked") K key = (K) stream.readObject();
      @SuppressWarnings("unchecked") V val = (V) stream.readObject();
      constructorPut(key, val);
    }
  }
}
java.utilHashMapconstructorPut

Javadoc

This method is just like put, except that it doesn't do things that are inappropriate or unnecessary for constructors and pseudo-constructors (i.e., clone, readObject). In particular, this method does not check to ensure that capacity is sufficient, and does not increment modCount.

Popular methods of HashMap

  • <init>
    Constructs a new HashMap instance containing the mappings from the specified map.
  • put
    Maps the specified key to the specified value.
  • get
    Returns the value of the mapping with the specified key.
  • containsKey
    Returns whether this map contains the specified key.
  • keySet
    Returns a set of the keys contained in this map. The set is backed by this map so changes to one are
  • remove
  • entrySet
    Returns a set containing all of the mappings in this map. Each mapping is an instance of Map.Entry.
  • values
    Returns a collection of the values contained in this map. The collection is backed by this map so ch
  • size
    Returns the number of elements in this map.
  • clear
    Removes all mappings from this hash map, leaving it empty.
  • isEmpty
    Returns whether this map is empty.
  • putAll
    Copies all the mappings in the specified map to this map. These mappings will replace all mappings t
  • isEmpty,
  • putAll,
  • clone,
  • toString,
  • containsValue,
  • equals,
  • hashCode,
  • computeIfAbsent,
  • getOrDefault,
  • forEach

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setRequestProperty (URLConnection)
  • getResourceAsStream (ClassLoader)
  • putExtra (Intent)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now