• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CompoundEnumeration类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中sun.misc.CompoundEnumeration的典型用法代码示例。如果您正苦于以下问题:Java CompoundEnumeration类的具体用法?Java CompoundEnumeration怎么用?Java CompoundEnumeration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CompoundEnumeration类属于sun.misc包,在下文中一共展示了CompoundEnumeration类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getResources

import sun.misc.CompoundEnumeration; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Enumeration<URL> getResources(final String name) throws IOException {
    // Let's find us all resources.
    @SuppressWarnings("unchecked")
    final Enumeration<URL>[] resources = (Enumeration<URL>[]) new Enumeration<?>[2];

    // Instead of returning our parent's resources first,
    // we'll return our own resources first.
    resources[0] = findResources(name);
    resources[1] = this.parent.getResources(name);

    // TODO: Replace by our own implementation. It's simple!
    // First return all elements from the enumeration at index 0,
    // then all elements from the enumeration at index 1,
    // etc.. Or generalize to take an enumeration of enumerations
    // and flatten them?
    return new CompoundEnumeration<>(resources);
}
 
开发者ID:metaborg,项目名称:spoofax-intellij,代码行数:22,代码来源:PriorityURLClassLoader.java


示例2: findResources

import sun.misc.CompoundEnumeration; //导入依赖的package包/类
public Enumeration<URL> findResources(final String name) throws IOException {
  final long started = myDebugTime ? System.nanoTime() : 0;
  try {
    final Enumeration[] resources = new Enumeration[myParents.length + 1];
    resources[0] = super.findResources(name);
    for (int idx = 0; idx < myParents.length; idx++) {
      resources[idx + 1] = fetchResources(myParents[idx], name);
    }
    return new CompoundEnumeration<URL>(resources);
  }
  finally {
    long doneFor = myDebugTime ? System.nanoTime() - started:0;
    if (doneFor > NS_THRESHOLD) {
      System.out.println((doneFor / 1000000) + " ms for " + (myPluginId != null?myPluginId.getIdString():null)+ ", find resources:"+name);
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:PluginClassLoader.java


示例3: findResources

import sun.misc.CompoundEnumeration; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
protected Enumeration<URL> findResources(String name) throws IOException {
	Enumeration tmp[] = new Enumeration[delegates.length];
	for (int i = 0; i < tmp.length; i++)
		tmp[i] = delegates[i].getResources(name);
	return new CompoundEnumeration(tmp);
}
 
开发者ID:infobip,项目名称:jboss-wildfly-remoting,代码行数:9,代码来源:AluniteClassLoader.java


示例4: findResources

import sun.misc.CompoundEnumeration; //导入依赖的package包/类
@Override
public Enumeration<URL> findResources(final String name) throws IOException {
  final Enumeration[] resources = new Enumeration[myParents.length + 1];
  resources[0] = super.findResources(name);
  for (int idx = 0; idx < myParents.length; idx++) {
    resources[idx + 1] = fetchResources(myParents[idx], name);
  }
  return new CompoundEnumeration<URL>(resources);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:PluginClassLoader.java


示例5: getResources

import sun.misc.CompoundEnumeration; //导入依赖的package包/类
@SuppressWarnings({"unchecked","rawtypes"})
public Enumeration<URL> getResources(String name) throws IOException {
  Enumeration<URL>[] resEnum = new Enumeration[2];

  if(parent == null) {
    resEnum[0] = getSystemClassLoader().getResourcesURL(name);
  } else{
    resEnum[0] = parent.getResources(name);
  }
  resEnum[1] = findResources(name);

  return new CompoundEnumeration<URL>(resEnum);
}
 
开发者ID:grzesuav,项目名称:gjpf-core,代码行数:14,代码来源:ClassLoader.java


示例6: getResources

import sun.misc.CompoundEnumeration; //导入依赖的package包/类
public Enumeration<URL> getResources(String name) throws IOException {
    Enumeration<URL>[] tmp = (Enumeration<URL>[]) new Enumeration<?>[2];
    tmp[0] = super.getResources(name);
    tmp[1] = defaultClassLoader.getResources(name);
    return new CompoundEnumeration<>(tmp);
}
 
开发者ID:alibaba,项目名称:jstorm,代码行数:7,代码来源:WorkerClassLoader.java


示例7: getResources

import sun.misc.CompoundEnumeration; //导入依赖的package包/类
/**
 * Finds all the resources with the given name. A resource is some data
 * (images, audio, text, etc) that can be accessed by class code in a way
 * that is independent of the location of the code.
 *
 * <p>The name of a resource is a <tt>/</tt>-separated path name that
 * identifies the resource.
 *
 * <p> The search order is described in the documentation for {@link
 * #getResource(String)}.  </p>
 *
 * @apiNote When overriding this method it is recommended that an
 * implementation ensures that any delegation is consistent with the {@link
 * #getResource(java.lang.String) getResource(String)} method. This should
 * ensure that the first element returned by the Enumeration's
 * {@code nextElement} method is the same resource that the
 * {@code getResource(String)} method would return.
 *
 * @param  name
 *         The resource name
 *
 * @return  An enumeration of {@link java.net.URL <tt>URL</tt>} objects for
 *          the resource.  If no resources could  be found, the enumeration
 *          will be empty.  Resources that the class loader doesn't have
 *          access to will not be in the enumeration.
 *
 * @throws  IOException
 *          If I/O errors occur
 *
 * @see  #findResources(String)
 *
 * @since  1.2
 */
public Enumeration<URL> getResources(String name) throws IOException {
    @SuppressWarnings("unchecked")
    Enumeration<URL>[] tmp = (Enumeration<URL>[]) new Enumeration<?>[2];
    if (parent != null) {
        tmp[0] = parent.getResources(name);
    } else {
        tmp[0] = getBootstrapResources(name);
    }
    tmp[1] = findResources(name);

    return new CompoundEnumeration<>(tmp);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:46,代码来源:ClassLoader.java


示例8: getResources

import sun.misc.CompoundEnumeration; //导入依赖的package包/类
/**
    * Finds all the resources with the given name. A resource is some data
    * (images, audio, text, etc) that can be accessed by class code in a way
    * that is independent of the location of the code.<p>
    *
    * The name of a resource is a "/"-separated path name that identifies the
    * resource.<p>
    *
    * The search order is described in the documentation for {@link
    * #getResource(String)}.<p>
    *
    * @param  name resource name
    * @return an enumeration of URL to the resource. If no resources could
    *         be found, the enumeration will be empty. Resources that the
    *         doesn't have access to will not be in the enumeration.
    * @throws IOException if I/O errors occur
    * @since  1.2
    * @see    #getResource
    * @see #findResources
    */
   public final Enumeration getResources(String name) throws IOException {
Enumeration[] tmp = new Enumeration[2];
if (parent != null) {
    tmp[0] = parent.getResources(name);
} else {
    tmp[0] = getBootstrapResources(name);
}
tmp[1] = findResources(name);

return new CompoundEnumeration(tmp);
   }
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:aClassLoader.java


示例9: getResources

import sun.misc.CompoundEnumeration; //导入依赖的package包/类
/**
    * Finds all the resources with the given name. A resource is some data
    * (images, audio, text, etc) that can be accessed by class code in a way
    * that is independent of the location of the code.
    *
    * <p>The name of a resource is a <tt>/</tt>-separated path name that
    * identifies the resource.
    *
    * <p> The search order is described in the documentation for {@link
    * #getResource(String)}.  </p>
    *
    * @param  name
    *         The resource name
    *
    * @return  An enumeration of {@link java.net.URL <tt>URL</tt>} objects for
    *          the resource.  If no resources could  be found, the enumeration
    *          will be empty.  Resources that the class loader doesn't have
    *          access to will not be in the enumeration.
    *
    * @throws  IOException
    *          If I/O errors occur
    *
    * @see  #findResources(String)
    *
    * @since  1.2
    */
   public Enumeration<URL> getResources(String name) throws IOException {
Enumeration[] tmp = new Enumeration[2];
if (parent != null) {
    tmp[0] = parent.getResources(name);
} else {
    tmp[0] = getBootstrapResources(name);
}
tmp[1] = findResources(name);

return new CompoundEnumeration(tmp);
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:38,代码来源:ClassLoader.java


示例10: getResources

import sun.misc.CompoundEnumeration; //导入依赖的package包/类
/**
 * Finds all the resources with the given name. A resource is some data
 * (images, audio, text, etc) that can be accessed by class code in a way
 * that is independent of the location of the code.
 *
 * <p>The name of a resource is a <tt>/</tt>-separated path name that
 * identifies the resource.
 *
 * <p> The search order is described in the documentation for {@link
 * #getResource(String)}.  </p>
 *
 * @param  name
 *         The resource name
 *
 * @return  An enumeration of {@link java.net.URL <tt>URL</tt>} objects for
 *          the resource.  If no resources could  be found, the enumeration
 *          will be empty.  Resources that the class loader doesn't have
 *          access to will not be in the enumeration.
 *
 * @throws  IOException
 *          If I/O errors occur
 *
 * @see  #findResources(String)
 *
 * @since  1.2
 */
public Enumeration<URL> getResources(String name) throws IOException {
    Enumeration[] tmp = new Enumeration[2];
    if (parent != null) {
        tmp[0] = parent.getResources(name);
    } else {
        tmp[0] = getBootstrapResources(name);
    }
    tmp[1] = findResources(name);

    return new CompoundEnumeration<>(tmp);
}
 
开发者ID:ZhaoX,项目名称:jdk-1.7-annotated,代码行数:38,代码来源:ClassLoader.java


示例11: findResources

import sun.misc.CompoundEnumeration; //导入依赖的package包/类
/**
    * Returns an Enumeration of URLs representing all the resources with
    * the given name. Class loader implementations should override this
    * method to specify where to load resources from.
    *
    * @param  name the resource name
    * @return an Enumeration of URLs for the resources
    * @throws IOException if I/O errors occur
    * @since  1.2
    */
   protected Enumeration findResources(String name) throws IOException {
return new CompoundEnumeration(new Enumeration[0]);
   }
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:aClassLoader.java


示例12: findResources

import sun.misc.CompoundEnumeration; //导入依赖的package包/类
/**
    * Returns an enumeration of {@link java.net.URL <tt>URL</tt>} objects
    * representing all the resources with the given name. Class loader
    * implementations should override this method to specify where to load
    * resources from.  </p>
    *
    * @param  name
    *         The resource name
    *
    * @return  An enumeration of {@link java.net.URL <tt>URL</tt>} objects for
    *          the resources
    *
    * @throws  IOException
    *          If I/O errors occur
    *
    * @since  1.2
    */
   protected Enumeration<URL> findResources(String name) throws IOException {
return new CompoundEnumeration(new Enumeration[0]);
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:21,代码来源:ClassLoader.java



注:本文中的sun.misc.CompoundEnumeration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java VerticalGroup类代码示例发布时间:2022-05-21
下一篇:
Java LinkedHashModel类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap