本文整理汇总了Java中java.util.Collections.enumeration方法的典型用法代码示例。如果您正苦于以下问题:Java Collections.enumeration方法的具体用法?Java Collections.enumeration怎么用?Java Collections.enumeration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.Collections
的用法示例。
在下文中一共展示了Collections.enumeration方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cleanChildren
import java.util.Collections; //导入方法依赖的package包/类
protected void cleanChildren() {
if (childrenSteps != null) {
//Enumeration e = childrenSteps.elements();
Enumeration<String> e = Collections.enumeration(childrenSteps.keySet());
while (e.hasMoreElements()) {
String timeID = (String)e.nextElement();
if (timeID != null) {
Long stepPriority = null;
Step step = sequence.getCopy(timeID);
if (step != null) {
stepPriority = new Long(step.priority);
step.cleanCopy();
}
sequence.removeCopy(timeID, stepPriority);
}
}
childrenSteps.clear();
}
}
示例2: toBufferedInputStream
import java.util.Collections; //导入方法依赖的package包/类
/**
* Gets the current contents of this byte stream as a Input Stream. The
* returned stream is backed by buffers of <code>this</code> stream,
* avoiding memory allocation and copy, thus saving space and time.<br>
*
* @return the current contents of this output stream.
* @see java.io.ByteArrayOutputStream#toByteArray()
* @see #reset()
* @since 2.0
*/
private InputStream toBufferedInputStream() {
int remaining = count;
if (remaining == 0) {
return new ClosedInputStream();
}
List<ByteArrayInputStream> list = new ArrayList<ByteArrayInputStream>(buffers.size());
for (byte[] buf : buffers) {
int c = Math.min(buf.length, remaining);
list.add(new ByteArrayInputStream(buf, 0, c));
remaining -= c;
if (remaining == 0) {
break;
}
}
return new SequenceInputStream(Collections.enumeration(list));
}
示例3: getDeclaredPrefixes
import java.util.Collections; //导入方法依赖的package包/类
/**
* Return an enumeration of prefixes declared in this context.
*
* @return An enumeration of prefixes (possibly empty).
* @see org.xml.sax.helpers.NamespaceSupport#getDeclaredPrefixes
*/
Enumeration getDeclaredPrefixes ()
{
if (declarations == null) {
return EMPTY_ENUMERATION;
} else {
return Collections.enumeration(declarations);
}
}
示例4: getInputStream
import java.util.Collections; //导入方法依赖的package包/类
public InputStream getInputStream() throws IOException
{
List<InputStream> inputSteamList = new ArrayList<InputStream>(_uploadedFileChunkList.size());
for (UploadedFile uploadedFileChunk : _uploadedFileChunkList)
inputSteamList.add(uploadedFileChunk.getInputStream());
return new SequenceInputStream(Collections.enumeration(inputSteamList));
}
示例5: maakLogischBestand
import java.util.Collections; //导入方法依赖的package包/类
private static SequenceInputStream maakLogischBestand(final List<Path> paths) {
final List<InputStream> inputStreamList = Lists.newArrayList();
for (Path path : paths) {
try {
final FileInputStream fileInputStream = new FileInputStream(path.toFile());
inputStreamList.add(fileInputStream);
} catch (FileNotFoundException e) {
inputStreamList.forEach(IOUtils::closeQuietly);
throw new IllegalStateException(e);
}
}
return new SequenceInputStream(Collections.enumeration(inputStreamList));
}
示例6: enabled
import java.util.Collections; //导入方法依赖的package包/类
@Override
public Enumeration enabled(GrammarEnvironment ctx) {
// check if is supported environment..
if (getGrammar(ctx) != null) {
Enumeration en = ctx.getDocumentChildren();
while (en.hasMoreElements()) {
Node next = (Node)en.nextElement();
if (next.getNodeType() == Node.ELEMENT_NODE) {
return Collections.enumeration(Collections.singletonList(next));
}
}
}
return null;
}
示例7: getAttributeNames
import java.util.Collections; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public Enumeration<String> getAttributeNames() {
Set<String> names = new HashSet<String>();
names.addAll(attributes.keySet());
return new MultiEnumeration<String>(
new Enumeration[] { super.getAttributeNames(), Collections.enumeration(names) });
}
示例8: getKeys
import java.util.Collections; //导入方法依赖的package包/类
@Override
public Enumeration<String> getKeys() {
return Collections.enumeration(keySet());
}
示例9: buildHeaderAccept
import java.util.Collections; //导入方法依赖的package包/类
private static Enumeration<String> buildHeaderAccept() {
return Collections.enumeration(Arrays.asList("application/json"));
}
示例10: getAttributeNames
import java.util.Collections; //导入方法依赖的package包/类
public Enumeration<String> getAttributeNames() {
return Collections.enumeration(keys());
}
示例11: run
import java.util.Collections; //导入方法依赖的package包/类
public void run() {
Display display = Display.getDefault();
Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
Shell shell = getParentShell();
shell.setCursor(waitCursor);
try {
treeNodesToUpdate = new ArrayList<TreeParent>();
ProjectExplorerView explorerView = getProjectExplorerView();
if (explorerView != null) {
TreeObject[] treeObjects = explorerView.getSelectedTreeObjects();
String[] selectedPaths = new String[treeObjects.length];
if (treeObjects != null) {
// Increase priority
TreeObject treeObject = null;
for (int i = 0 ; i < treeObjects.length ; i++) {
treeObject = treeObjects[i];
selectedPaths[i] = treeObject.getPath();
increasePriority(treeObject);
}
// Updating the tree and the properties panel
Enumeration<TreeParent> enumeration = Collections.enumeration(treeNodesToUpdate);
TreeParent parentTreeObject = null;
while (enumeration.hasMoreElements()) {
parentTreeObject = enumeration.nextElement();
explorerView.reloadTreeObject(parentTreeObject);
}
// Restore selection
TreeObjectEvent treeObjectEvent;
for (int i=0; i<selectedPaths.length; i++) {
String previousPath = selectedPaths[i];
treeObject = explorerView.findTreeObjectByPath(parentTreeObject, previousPath);
if (treeObject != null) {
treeObjects[i] = treeObject;
treeObjectEvent = new TreeObjectEvent(treeObject);
explorerView.fireTreeObjectPropertyChanged(treeObjectEvent);
}
}
explorerView.setSelectedTreeObjects(treeObjects);
}
}
}
catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to increase priority!");
}
finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
示例12: getInitParameterNames
import java.util.Collections; //导入方法依赖的package包/类
@Override
public Enumeration<String> getInitParameterNames() {
return Collections.enumeration(initParameters.keySet());
}
示例13: getComponents
import java.util.Collections; //导入方法依赖的package包/类
/**
* @return all build components that are an instance of the given class
* @deprecated Use {@link #getComponentsOf(Class<T>)} instead.
*/
@Deprecated
public <T> Enumeration<T> getComponents(Class<T> target) {
return Collections.enumeration(getComponentsOf(target));
}
示例14: getAllBoards
import java.util.Collections; //导入方法依赖的package包/类
/**
* @return an Enumeration of all {@link Board}s on the map
* @deprecated Use {@link #getBoards()} instead.
*/
@Deprecated
public Enumeration<Board> getAllBoards() {
return Collections.enumeration(boards);
}
示例15: loaders
import java.util.Collections; //导入方法依赖的package包/类
protected Enumeration<? extends DataLoader> loaders() {
return Collections.enumeration(result.allInstances());
}