當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。