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

x33g5p2x  于2022-01-15 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(84)

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

Attributes.clone介绍

[英]Returns a copy of the Attributes, implemented as follows:

public Object clone() { return new Attributes(this); }

Since the attribute names and values are themselves immutable, the Attributes returned can be safely modified without affecting the original.
[中]返回属性的副本,实现方式如下:

public Object clone() { return new Attributes(this); }

由于属性名称和值本身是不可变的,因此可以安全地修改返回的属性,而不会影响原始属性。

代码示例

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

/**
 * Creates a new {@code Manifest} instance. The new instance will have the
 * same attributes as those found in the parameter {@code Manifest}.
 *
 * @param man
 *            {@code Manifest} instance to obtain attributes from.
 */
@SuppressWarnings("unchecked")
public Manifest(Manifest man) {
  mainAttributes = (Attributes) man.mainAttributes.clone();
  entries = (HashMap<String, Attributes>) ((HashMap<String, Attributes>) man
      .getEntries()).clone();
}

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

target.getEntries().put( o.getKey(), (Attributes) otherSection.clone() );

代码示例来源:origin: MobiVM/robovm

/**
 * Creates a new {@code Manifest} instance. The new instance will have the
 * same attributes as those found in the parameter {@code Manifest}.
 *
 * @param man
 *            {@code Manifest} instance to obtain attributes from.
 */
@SuppressWarnings("unchecked")
public Manifest(Manifest man) {
  mainAttributes = (Attributes) man.mainAttributes.clone();
  entries = (HashMap<String, Attributes>) ((HashMap<String, Attributes>) man
      .getEntries()).clone();
}

代码示例来源:origin: ibinti/bugvm

/**
 * Creates a new {@code Manifest} instance. The new instance will have the
 * same attributes as those found in the parameter {@code Manifest}.
 *
 * @param man
 *            {@code Manifest} instance to obtain attributes from.
 */
@SuppressWarnings("unchecked")
public Manifest(Manifest man) {
  mainAttributes = (Attributes) man.mainAttributes.clone();
  entries = (HashMap<String, Attributes>) ((HashMap<String, Attributes>) man
      .getEntries()).clone();
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Creates a new {@code Manifest} instance. The new instance will have the
 * same attributes as those found in the parameter {@code Manifest}.
 *
 * @param man
 *            {@code Manifest} instance to obtain attributes from.
 */
@SuppressWarnings("unchecked")
public Manifest(Manifest man) {
  mainAttributes = (Attributes) man.mainAttributes.clone();
  entries = (HashMap<String, Attributes>) ((HashMap<String, Attributes>) man
      .getEntries()).clone();
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Creates a new {@code Manifest} instance. The new instance will have the
 * same attributes as those found in the parameter {@code Manifest}.
 *
 * @param man
 *            {@code Manifest} instance to obtain attributes from.
 */
@SuppressWarnings("unchecked")
public Manifest(Manifest man) {
  mainAttributes = (Attributes) man.mainAttributes.clone();
  entries = (HashMap<String, Attributes>) ((HashMap<String, Attributes>) man
      .getEntries()).clone();
}

代码示例来源:origin: com.jtransc/jtransc-rt

/**
 * Creates a new {@code Manifest} instance. The new instance will have the
 * same attributes as those found in the parameter {@code Manifest}.
 *
 * @param man
 *            {@code Manifest} instance to obtain attributes from.
 */
@SuppressWarnings("unchecked")
public Manifest(Manifest man) {
  mainAttributes = (Attributes) man.mainAttributes.clone();
  entries = (HashMap<String, Attributes>) ((HashMap<String, Attributes>) man
      .getEntries()).clone();
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Creates a new {@code Manifest} instance. The new instance will have the
 * same attributes as those found in the parameter {@code Manifest}.
 *
 * @param man
 *            {@code Manifest} instance to obtain attributes from.
 */
@SuppressWarnings("unchecked")
public Manifest(Manifest man) {
  mainAttributes = (Attributes) man.mainAttributes.clone();
  entries = (HashMap<String, Attributes>) ((HashMap<String, Attributes>) man
      .getEntries()).clone();
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Creates a new {@code Manifest} instance. The new instance will have the
 * same attributes as those found in the parameter {@code Manifest}.
 *
 * @param man
 *            {@code Manifest} instance to obtain attributes from.
 */
@SuppressWarnings("unchecked")
public Manifest(Manifest man) {
  mainAttributes = (Attributes) man.mainAttributes.clone();
  entries = (HashMap<String, Attributes>) ((HashMap<String, Attributes>) man
      .getEntries()).clone();
}

相关文章