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

How to use
clone
method
in
java.util.HashMap

Best Java code snippets using java.util.HashMap.clone (Showing top 20 results out of 3,474)

origin: Netflix/zuul

/**
 * Makes a copy of the RequestContext. This is used for debugging.
 *
 * @return
 */
@Override
public SessionContext clone()
{
  return (SessionContext) super.clone();
}
origin: Netflix/zuul

public ChannelConfig(HashMap<ChannelConfigKey, ChannelConfigValue> parameters)
{
  this.parameters = (HashMap<ChannelConfigKey, ChannelConfigValue>) parameters.clone();
}
origin: jersey/jersey

  @Override
  public OAuth1Parameters clone() {
    return (OAuth1Parameters) super.clone();
  }
}
origin: wildfly/wildfly

private Node(String child_name, String fqn, Node parent, Map<String,Object> data) {
  name=child_name;
  this.fqn=fqn;
  this.parent=parent;
  if(data != null) this.data=(HashMap<String,Object>)((HashMap)data).clone();
}
origin: robovm/robovm

/**
 * Constructs an {@code Attributes} instance obtaining keys and values from
 * the parameter {@code attrib}.
 *
 * @param attrib
 *            The attributes to obtain entries from.
 */
@SuppressWarnings("unchecked")
public Attributes(Attributes attrib) {
  map = (Map<Object, Object>) ((HashMap) attrib.map).clone();
}
origin: spring-projects/spring-framework

/**
 * Copy constructor.
 */
@SuppressWarnings("unchecked")
private LinkedCaseInsensitiveMap(LinkedCaseInsensitiveMap<V> other) {
  this.targetMap = (LinkedHashMap<String, V>) other.targetMap.clone();
  this.caseInsensitiveKeys = (HashMap<String, String>) other.caseInsensitiveKeys.clone();
  this.locale = other.locale;
}
origin: apache/ignite

  /**
   * Returns a shallow copy of this {@code GridBoundedLinkedHashSet}
   * instance: the elements themselves are not cloned.
   *
   * @return a shallow copy of this set.
   * @throws CloneNotSupportedException Thrown if cloning is not supported.
   */
  @Override public Object clone() throws CloneNotSupportedException {
    GridBoundedLinkedHashSet<E> newSet = (GridBoundedLinkedHashSet<E>)super.clone();

    newSet.map = (HashMap<E, Object>)map.clone();

    return newSet;
  }
}
origin: robovm/robovm

@SuppressWarnings("unchecked")
@Override
public Object clone() {
  Attributes clone;
  try {
    clone = (Attributes) super.clone();
  } catch (CloneNotSupportedException e) {
    throw new AssertionError(e);
  }
  clone.map = (Map<Object, Object>) ((HashMap) map).clone();
  return clone;
}
origin: Netflix/zuul

/**
 * Makes a copy of the RequestContext. This is used for debugging.
 *
 * @return
 */
@Override
public SessionContext clone()
{
  return (SessionContext) super.clone();
}
origin: Netflix/zuul

public ChannelConfig(HashMap<ChannelConfigKey, ChannelConfigValue> parameters)
{
  this.parameters = (HashMap<ChannelConfigKey, ChannelConfigValue>) parameters.clone();
}
origin: org.springframework/spring-core

/**
 * Copy constructor.
 */
@SuppressWarnings("unchecked")
private LinkedCaseInsensitiveMap(LinkedCaseInsensitiveMap<V> other) {
  this.targetMap = (LinkedHashMap<String, V>) other.targetMap.clone();
  this.caseInsensitiveKeys = (HashMap<String, String>) other.caseInsensitiveKeys.clone();
  this.locale = other.locale;
}
origin: quartz-scheduler/quartz

@Override
@SuppressWarnings("unchecked") // suppress warnings on generic cast of super.clone() and map.clone() lines.
public Object clone() {
  DirtyFlagMap<K,V> copy;
  try {
    copy = (DirtyFlagMap<K,V>) super.clone();
    if (map instanceof HashMap) {
      copy.map = (Map<K,V>)((HashMap<K,V>)map).clone();
    }
  } catch (CloneNotSupportedException ex) {
    throw new IncompatibleClassChangeError("Not Cloneable.");
  }
  return copy;
}
origin: org.freemarker/freemarker

  @Override
  public Map getParameterMap() {
    HashMap clone = (HashMap) paramsMap.clone();
    for (Iterator it = clone.entrySet().iterator(); it.hasNext(); ) {
      Map.Entry entry = (Map.Entry) it.next();
      entry.setValue(((String[]) entry.getValue()).clone());
    }
    return Collections.unmodifiableMap(clone);
  }
}
origin: commonsguy/cw-omnibus

@Override
public void cancel() {
  if (mAnimatorMap.size() > 0) {
    HashMap<Animator, PropertyBundle> mAnimatorMapCopy =
        (HashMap<Animator, PropertyBundle>)mAnimatorMap.clone();
    Set<Animator> animatorSet = mAnimatorMapCopy.keySet();
    for (Animator runningAnim : animatorSet) {
      runningAnim.cancel();
    }
  }
  mPendingAnimations.clear();
  View v = mView.get();
  if (v != null) {
    v.removeCallbacks(mAnimationStarter);
  }
}
origin: commonsguy/cw-omnibus

@Override
public void cancel() {
  if (mAnimatorMap.size() > 0) {
    HashMap<Animator, PropertyBundle> mAnimatorMapCopy =
        (HashMap<Animator, PropertyBundle>)mAnimatorMap.clone();
    Set<Animator> animatorSet = mAnimatorMapCopy.keySet();
    for (Animator runningAnim : animatorSet) {
      runningAnim.cancel();
    }
  }
  mPendingAnimations.clear();
  View v = mView.get();
  if (v != null) {
    v.removeCallbacks(mAnimationStarter);
  }
}
origin: commons-collections/commons-collections

public boolean remove(Object o) {
  if (fast) {
    synchronized (FastHashMap.this) {
      HashMap temp = (HashMap) map.clone();
      boolean r = get(temp).remove(o);
      map = temp;
      return r;
    }
  } else {
    synchronized (map) {
      return get(map).remove(o);
    }
  }
}
origin: commons-collections/commons-collections

public boolean removeAll(Collection o) {
  if (fast) {
    synchronized (FastHashMap.this) {
      HashMap temp = (HashMap) map.clone();
      boolean r = get(temp).removeAll(o);
      map = temp;
      return r;
    }
  } else {
    synchronized (map) {
      return get(map).removeAll(o);
    }
  }
}
origin: commons-collections/commons-collections

public boolean retainAll(Collection o) {
  if (fast) {
    synchronized (FastHashMap.this) {
      HashMap temp = (HashMap) map.clone();
      boolean r = get(temp).retainAll(o);
      map = temp;
      return r;
    }
  } else {
    synchronized (map) {
      return get(map).retainAll(o);
    }
  }
}
origin: googlemaps/android-maps-utils

@SuppressWarnings("unchecked")
@Override
public BiMultiMap<K> clone() {
  BiMultiMap<K> cloned = new BiMultiMap<>();
  cloned.putAll((Map<K, Object>) super.clone());
  return cloned;
}
origin: ethereum/ethereumj

@Override
public ContractDetails clone() {
  ContractDetailsCacheImpl contractDetails = new ContractDetailsCacheImpl(origContract);
  Object storageClone = ((HashMap<DataWord, DataWord>)storage).clone();
  contractDetails.setCode(this.getCode());
  contractDetails.setStorage( (HashMap<DataWord, DataWord>) storageClone);
  return contractDetails;
}
java.utilHashMapclone

Javadoc

Returns a shallow copy of this map.

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,
  • 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
  • CodeWhisperer alternatives
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