本文整理汇总了Java中java.util.Collections.emptyEnumeration方法的典型用法代码示例。如果您正苦于以下问题:Java Collections.emptyEnumeration方法的具体用法?Java Collections.emptyEnumeration怎么用?Java Collections.emptyEnumeration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.Collections
的用法示例。
在下文中一共展示了Collections.emptyEnumeration方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getHeaders
import java.util.Collections; //导入方法依赖的package包/类
@Override
public Enumeration<String> getHeaders(String name) {
List<String> headerValues = httpHeaders.get(name);
if (headerValues == null || headerValues.isEmpty()) {
return Collections.emptyEnumeration();
}
return Collections.enumeration(headerValues);
}
示例2: findResources
import java.util.Collections; //导入方法依赖的package包/类
@Override
public Enumeration<URL> findResources(String name) throws IOException {
Enumeration<URL> origResources = getParent().getResources(name);
Enumeration<URL> deleResources = oldDelegate != null ? oldDelegate.findResources(name) : Collections.<URL>emptyEnumeration();
return new CompoundEnumeration<URL>(new Enumeration[] {
origResources,
deleResources,
super.findResources(name)
});
}
示例3: attributes
import java.util.Collections; //导入方法依赖的package包/类
@Override
public Enumeration<String> attributes(String name) {
Item item = getItem(name);
if (item != null) {
return item.getAttributes();
} else {
return Collections.emptyEnumeration();
}
}
示例4: children
import java.util.Collections; //导入方法依赖的package包/类
public Enumeration<CCTNode> children() {
final CCTNode[] _children = getChildren();
final int _childrenCount = _children == null ? 0 : _children.length;
if (_childrenCount == 0) return Collections.emptyEnumeration();
return new Enumeration<CCTNode>() {
private int index = 0;
public boolean hasMoreElements() { return index < _childrenCount; }
public CCTNode nextElement() { return _children[index++]; }
};
}
示例5: findResourcesOnClassPath
import java.util.Collections; //导入方法依赖的package包/类
/**
* Returns the URLs of all resources of the given name on the class path.
*/
private Enumeration<URL> findResourcesOnClassPath(String name) {
if (hasClassPath()) {
if (System.getSecurityManager() == null) {
return ucp.findResources(name, false);
} else {
PrivilegedAction<Enumeration<URL>> pa;
pa = () -> ucp.findResources(name, false);
return AccessController.doPrivileged(pa);
}
} else {
// no class path
return Collections.emptyEnumeration();
}
}
示例6: getEnumeration
import java.util.Collections; //导入方法依赖的package包/类
@Override
public Enumeration<?> getEnumeration() throws JMSException {
checkClosed();
return Collections.emptyEnumeration();
}
示例7: getInitParameterNames
import java.util.Collections; //导入方法依赖的package包/类
@Override
public Enumeration<String> getInitParameterNames() {
return Collections.emptyEnumeration();
}
示例8: getAttributeNames
import java.util.Collections; //导入方法依赖的package包/类
public Enumeration getAttributeNames() {
return Collections.emptyEnumeration();
}
示例9: getAttributeNames
import java.util.Collections; //导入方法依赖的package包/类
public Enumeration<?> getAttributeNames() {
return Collections.emptyEnumeration();
}
示例10: getKeys
import java.util.Collections; //导入方法依赖的package包/类
@Override
public Enumeration<String> getKeys() {
return Collections.emptyEnumeration();
}
示例11: findResources
import java.util.Collections; //导入方法依赖的package包/类
/**
* Returns an enumeration of {@link java.net.URL URL} objects
* representing all the resources with the given name. Class loader
* implementations should override this method.
*
* <p> For resources in named modules then the method must implement the
* rules for encapsulation specified in the {@code Module} {@link
* Module#getResourceAsStream getResourceAsStream} method. Additionally,
* it must not find non-"{@code .class}" resources in packages of named
* modules unless the package is {@link Module#isOpen(String) opened}
* unconditionally. </p>
*
* @implSpec The default implementation returns an enumeration that
* contains no elements.
*
* @param name
* The resource name
*
* @return An enumeration of {@link java.net.URL URL} objects for
* the resource. If no resources could be found, the enumeration
* will be empty. Resources for which a {@code URL} cannot be
* constructed, are in a package that is not opened unconditionally,
* or access to the resource is denied by the security manager,
* are not returned in the enumeration.
*
* @throws IOException
* If I/O errors occur
*
* @since 1.2
* @revised 9
* @spec JPMS
*/
protected Enumeration<URL> findResources(String name) throws IOException {
return Collections.emptyEnumeration();
}