当前位置: 首页>>代码示例>>Java>>正文


Java Collections.enumeration方法代码示例

本文整理汇总了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();
	}
}
 
开发者ID:convertigo,项目名称:convertigo-engine,代码行数:20,代码来源:StepWithExpressions.java

示例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));
}
 
开发者ID:androidDaniel,项目名称:treasure,代码行数:27,代码来源:ByteArrayOutputStream.java

示例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);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:NamespaceSupport.java

示例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));
}
 
开发者ID:apache,项目名称:myfaces-trinidad,代码行数:9,代码来源:FileUploadConfiguratorImpl.java

示例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));
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:15,代码来源:SteekproefServiceImpl.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:MavenQueryProvider.java

示例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) });
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:10,代码来源:ReplicatedContext.java

示例8: getKeys

import java.util.Collections; //导入方法依赖的package包/类
@Override
public Enumeration<String> getKeys() {
    return Collections.enumeration(keySet());
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:ParallelListResourceBundle.java

示例9: buildHeaderAccept

import java.util.Collections; //导入方法依赖的package包/类
private static Enumeration<String> buildHeaderAccept() {
	return Collections.enumeration(Arrays.asList("application/json"));
}
 
开发者ID:holon-platform,项目名称:holon-core,代码行数:4,代码来源:TestHttpRequest.java

示例10: getAttributeNames

import java.util.Collections; //导入方法依赖的package包/类
public Enumeration<String> getAttributeNames() {
    return Collections.enumeration(keys());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:DocumentElement.java

示例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();
       }
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:55,代码来源:DatabaseObjectIncreasePriorityAction.java

示例12: getInitParameterNames

import java.util.Collections; //导入方法依赖的package包/类
@Override
public Enumeration<String> getInitParameterNames() {
    return Collections.enumeration(initParameters.keySet());
}
 
开发者ID:devefx,项目名称:validator-web,代码行数:5,代码来源:FakeServletConfig.java

示例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));
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:9,代码来源:AbstractBuildable.java

示例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);
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:9,代码来源:Map.java

示例15: loaders

import java.util.Collections; //导入方法依赖的package包/类
protected Enumeration<? extends DataLoader> loaders() {
    return Collections.enumeration(result.allInstances());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:InstantRenamePerformerTest.java


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