java.util.LinkedHashMap.clone()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(198)

本文整理了Java中java.util.LinkedHashMap.clone()方法的一些代码示例,展示了LinkedHashMap.clone()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LinkedHashMap.clone()方法的具体详情如下:
包路径:java.util.LinkedHashMap
类名称:LinkedHashMap
方法名:clone

LinkedHashMap.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: looly/hutool

@Override
  public Dict clone() {
    return (Dict) super.clone();
  }
}

代码示例来源:origin: looly/hutool

@Override
  public Dict clone() {
    return (Dict) super.clone();
  }
}

代码示例来源:origin: apache/ignite

/** {@inheritDoc} */
  @Override public Object clone() {
    GridBoundedLinkedHashMap<K, V> m = (GridBoundedLinkedHashMap<K, V>)super.clone();

    m.maxCap = maxCap;

    return m;
  }
}

代码示例来源:origin: org.codehaus.groovy/groovy

/**
   * Performs a shallow clone
   *
   * @return The cloned instance
   */
  @Override
  public Object clone() {
    return super.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: groovy/groovy-core

protected Object clone() throws CloneNotSupportedException {
  if (map == null) {
    return null;
  } else {
    if (map instanceof LinkedHashMap) {
      return ((LinkedHashMap) map).clone();
    } else {
      return new LinkedHashMap(this);
    }
  }
}

代码示例来源:origin: oblac/jodd

@Override
protected Object clone() {
  if (map == null) {
    return null;
  }
  if (map instanceof LinkedHashMap) {
    return ((LinkedHashMap) map).clone();
  }
  return copy(this);
}

代码示例来源:origin: org.freemarker/freemarker

@Override
protected Object clone() throws CloneNotSupportedException {
  Configurable copy = (Configurable) super.clone();
  if (properties != null) {
    copy.properties = new Properties(properties);
  }
  if (customAttributes != null) {
    copy.customAttributes = (HashMap) customAttributes.clone();
  }
  if (autoImports != null) {
    copy.autoImports = (LinkedHashMap<String, String>) autoImports.clone();
  }
  if (autoIncludes != null) {
    copy.autoIncludes = (ArrayList<String>) autoIncludes.clone();
  }
  return copy;
}

代码示例来源:origin: hsz/idea-gitignore

/**
   * Returns a shallow copy of this <tt>HashMap</tt> instance: the keys and
   * values themselves are not cloned.
   *
   * @return a shallow copy of this map
   */
  @Override
  public IgnoreLanguagesSettings clone() {
    IgnoreLanguagesSettings copy = (IgnoreLanguagesSettings) super.clone();
    for (Map.Entry<IgnoreLanguage, TreeMap<IgnoreLanguagesSettings.KEY, Object>> entry : copy.entrySet()) {
      @SuppressWarnings("unchecked")
      TreeMap<IgnoreLanguagesSettings.KEY, Object> data = (TreeMap<KEY, Object>) entry.getValue().clone();
      copy.put(entry.getKey(), data);
    }
    return copy;
  }
}

代码示例来源:origin: org.codehaus.groovy/groovy-json

protected Object clone() throws CloneNotSupportedException {
  if (map == null) {
    return null;
  } else {
    if (map instanceof LinkedHashMap) {
      return ((LinkedHashMap) map).clone();
    } else {
      return new LinkedHashMap(this);
    }
  }
}

代码示例来源:origin: yanzhenjie/AndServer

@SuppressWarnings("unchecked")
private LinkedCaseInsensitiveMap(LinkedCaseInsensitiveMap<V> other) {
  this.mSource = (LinkedHashMap<String, V>)other.mSource.clone();
  this.mCaseInsensitiveKeys = (HashMap<String, String>)other.mCaseInsensitiveKeys.clone();
  this.mLocale = other.mLocale; // No need to clone.
}

代码示例来源:origin: geotools/geotools

/**
   * Returns a shallow copy of this map.
   *
   * @return A shallow copy of this map.
   */
  @Override
  @SuppressWarnings("unchecked")
  public CheckedHashMap<K, V> clone() {
    synchronized (getLock()) {
      return (CheckedHashMap) super.clone();
    }
  }
}

代码示例来源:origin: org.utgenome.thirdparty/picard

public AbstractIndex(AbstractIndex parent) {
  this();
  this.version = parent.version;
  this.indexedFile = parent.indexedFile;
  this.indexedFileSize = parent.indexedFileSize;
  this.indexedFileTS = parent.indexedFileTS;
  this.indexedFileMD5 = parent.indexedFileMD5;
  this.flags = parent.flags;
  this.properties = (LinkedHashMap<String, String>) parent.properties.clone();
}

代码示例来源:origin: usc-isi-i2/Web-Karma

@Override
public Context clone() {
  final Context rval = (Context) super.clone();
  // TODO: is this shallow copy enough? probably not, but it passes all
  // the tests!
  rval.termDefinitions = new LinkedHashMap<>(this.termDefinitions);
  return rval;
}

代码示例来源:origin: jsonld-java/jsonld-java

@Override
public Context clone() {
  final Context rval = (Context) super.clone();
  // TODO: is this shallow copy enough? probably not, but it passes all
  // the tests!
  rval.termDefinitions = new LinkedHashMap<String, Object>(this.termDefinitions);
  return rval;
}

代码示例来源:origin: boonproject/boon

@Override
protected Object clone() throws CloneNotSupportedException {
  if (map == null) {
    return null;
  } else {
    if (map instanceof LinkedHashMap) {
      return ((LinkedHashMap) map).clone();
    } else {
      return Maps.copy(this);
    }
  }
}

代码示例来源:origin: boonproject/boon

@Override
protected Object clone() throws CloneNotSupportedException {
  if (map == null) {
    return null;
  } else {
    if (map instanceof LinkedHashMap) {
      return ((LinkedHashMap) map).clone();
    } else {
      return Maps.copy(this);
    }
  }
}

代码示例来源:origin: com.github.advantageous/boon-reflekt

@Override
protected Object clone() throws CloneNotSupportedException {
  if (map == null) {
    return null;
  } else {
    if (map instanceof LinkedHashMap) {
      return ((LinkedHashMap) map).clone();
    } else {
      return Maps.copy(this);
    }
  }
}

代码示例来源:origin: edu.utah.bmi.nlp/nlp-core

public RecordRow clone() {
    RecordRow newRecordRow = new RecordRow();
    newRecordRow.name_cells = (LinkedHashMap<String, Object>) this.name_cells.clone();
    newRecordRow.id_cells = (HashMap<Integer, Object>) this.id_cells.clone();
    return newRecordRow;
  }
}

相关文章