Java 8 Enumeration - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 Enumeration class.

This code example shows how to use the following methods:nextElement
        public boolean hasMore() { 
            return domains.hasMoreElements();
        } 
 
        public NameClassPair next() { 
            String name = (String) domains.nextElement();
            Object value = ctxMap.get(name);
            String className = value.getClass().getName();
            NameClassPair pair = new NameClassPair(name, className);
            return pair;
        } 
 
        public NameClassPair nextElement() { 
            return next(); 
        } 
    } 
} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:hasMoreElements, nextElement
	/* (non-Javadoc) 
	 * @see net.sf.jasperreports.engine.JRDataSource#next() 
	 */ 
	public boolean next() throws JRException { 
 
		if (e.hasMoreElements()) {
			currRow = e.nextElement();
			processedCount++;
			if (log.isInfoEnabled()) { 
				if (debugRow != null) {
					log.info("DetailRow: " + debugRow);
				} //~ if (debugRow != null) 
				debugRow = new NSMutableDictionary<String, Object>();
				if (currRow instanceof EOEnterpriseObject) {
					EOEnterpriseObject eo = (EOEnterpriseObject) currRow;
					debugRow.takeValueForKey(eo.editingContext().globalIDForObject(eo), "_globalID");
				} //~ if (currRow instanceof EOEnterpriseObject) 
			} //~ if (log.isDebugEnabled()) 
			return true; 
		} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:hasMoreElements, nextElement
          return null; 
        } 
        Enumeration<LedgerEntry> entries 
          = lh.readEntries(readEntries, readEntries);
        readEntries++;
        if (entries.hasMoreElements()) {
            LedgerEntry e = entries.nextElement();
            assert !entries.hasMoreElements();
            return e.getEntryInputStream();
        } 
      } catch (BKException e) {
        throw new IOException("Error reading entries from bookkeeper", e);
      } catch (InterruptedException e) {
        throw new IOException("Interrupted reading entries from bookkeeper", e);
      } 
      return null; 
    } 
 
    @Override 
    public int read() throws IOException { 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:hasMoreElements, nextElement
This code example shows how to use the following methods:hasMoreElements, nextElement
    { 
 
        Enumeration e = seq.getObjects();
 
        // status 
        pkiStatusInfo = PKIStatusInfo.getInstance(e.nextElement());
 
        if (e.hasMoreElements())
        { 
            timeStampToken = ContentInfo.getInstance(e.nextElement());
        } 
    } 
 
    public TimeStampResp(PKIStatusInfo pkiStatusInfo, ContentInfo timeStampToken)
    { 
        this.pkiStatusInfo = pkiStatusInfo;
        this.timeStampToken = timeStampToken;
    } 
 
    public PKIStatusInfo getStatus() 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:hasMoreElements, nextElement
    public DHParameter( 
        ASN1Sequence  seq)
    { 
        Enumeration     e = seq.getObjects();
 
        p = (DERInteger)e.nextElement();
        g = (DERInteger)e.nextElement();
 
        if (e.hasMoreElements())
        { 
            l = (DERInteger)e.nextElement();
        } 
        else 
        { 
            l = null;
        } 
    } 
 
    public BigInteger getP()
    { 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:hasMoreElements, nextElement
		if (path.length() == 0)
			path = "/"; //$NON-NLS-1$
		String file = resourceName.substring(lastSlash + 1);
		Enumeration entryPaths = bundle.findEntries(path, file, false);
 
		if (entryPaths != null && entryPaths.hasMoreElements())
			return (URL) entryPaths.nextElement();
 
		return null; 
	} 
 
	@SuppressWarnings("unchecked") 
	public Set getResourcePaths(String path) {
		if (bundlePath != null)
			path = bundlePath + path;
 
		Enumeration entryPaths = bundle.findEntries(path, null, false);
		if (entryPaths == null)
			return null; 
 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:hasMoreElements, nextElement
    public ContentInfo( 
        ASN1Sequence  seq)
    { 
        Enumeration   e = seq.getObjects();
 
        contentType = (DERObjectIdentifier)e.nextElement();
 
        if (e.hasMoreElements())
        { 
            content = ((ASN1TaggedObject)e.nextElement()).getObject();
        } 
    } 
 
    public ContentInfo( 
        DERObjectIdentifier contentType,
        DEREncodable        content)
    { 
        this.contentType = contentType;
        this.content = content;
    } 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:hasMoreElements, nextElement
    public PBKDF2Params( 
        ASN1Sequence  seq)
    { 
        Enumeration e = seq.getObjects();
 
        octStr = (ASN1OctetString)e.nextElement();
        iterationCount = (DERInteger)e.nextElement();
 
        if (e.hasMoreElements())
        { 
            keyLength = (DERInteger)e.nextElement();
        } 
        else 
        { 
            keyLength = null;
        } 
    } 
 
    public byte[] getSalt() 
    { 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:hasMoreElements, nextElement
 
	public void testKeyEnumerator() { 
		NSDictionary<String, String> dict = new NSDictionary<String, String>("value", "key");	
		Enumeration<String> e = dict.keyEnumerator();
		 
		assertTrue(e.hasMoreElements());
		assertEquals("key", e.nextElement());
		assertFalse(e.hasMoreElements());
		try { 
			e.nextElement();
			fail("Expected NoSuchElementException"); 
		} catch (NoSuchElementException ex) {} 
	} 
	 
	public void testObjectEnumerator() { 
		NSDictionary<String, String> dict = new NSDictionary<String, String>("value", "key");	
		Enumeration<String> e = dict.objectEnumerator();
		 
		assertTrue(e.hasMoreElements());
		assertEquals("value", e.nextElement());
6
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Java 8 Enumeration Questions & Answers:

See Code Examples for Java 8 Enumeration Methods: