Example usage for org.apache.commons.collections.iterators IteratorEnumeration IteratorEnumeration

List of usage examples for org.apache.commons.collections.iterators IteratorEnumeration IteratorEnumeration

Introduction

In this page you can find the example usage for org.apache.commons.collections.iterators IteratorEnumeration IteratorEnumeration.

Prototype

public IteratorEnumeration(Iterator iterator) 

Source Link

Document

Constructs a new IteratorEnumeration that will use the given iterator.

Usage

From source file:edu.northwestern.bioinformatics.studycalendar.tools.MapBasedDictionary.java

@Override
@SuppressWarnings({ "unchecked" })
public Enumeration<K> keys() {
    return new IteratorEnumeration(map.keySet().iterator());
}

From source file:edu.northwestern.bioinformatics.studycalendar.tools.MapBasedDictionary.java

@Override
@SuppressWarnings({ "unchecked" })
public Enumeration<V> elements() {
    return new IteratorEnumeration(map.values().iterator());
}

From source file:com.allogy.mime.MimeGeneratingInputStream.java

public MimeGeneratingInputStream(Iterable<Header> headers, InputStream bodyInputStream) {
    Iterable<InputStream> inputStreamHeaders = Iterables.transform(headers,
            new Function<Header, InputStream>() {
                public InputStream apply(@Nullable Header s) {
                    InputStream headerStream = new ByteArrayInputStream(s.toString().getBytes());
                    return new SequenceInputStream(headerStream,
                            new ByteArrayInputStream(MimeUtilities.CRLFEnding.getBytes()));
                }//  w  w  w  .  j  a v  a 2  s.  com
            });

    InputStream givenHeadersInputStream = new SequenceInputStream(
            new IteratorEnumeration(inputStreamHeaders.iterator()));

    InputStream headerInputStream = new SequenceInputStream(givenHeadersInputStream,
            new ByteArrayInputStream(MimeUtilities.CRLFEnding.getBytes()));

    innerInputStream = new SequenceInputStream(headerInputStream, bodyInputStream);
}

From source file:hermes.providers.file.FileQueueBrowser.java

public Enumeration getEnumeration() throws JMSException {
    try {//w ww.  j  a  va 2  s.c om
        return new IteratorEnumeration(queue.getMessages(factory, selector).iterator());
    } catch (IOException e) {
        throw new HermesException(e);
    }
}

From source file:de.innovationgate.wgpublisher.services.WGAServiceServletConfig.java

public Enumeration getInitParameterNames() {
    return new IteratorEnumeration(_initParams.keySet().iterator());
}

From source file:edu.wisc.my.stats.web.support.WritableHttpServletRequestWrapper.java

/**
 * @see javax.servlet.ServletRequestWrapper#getParameterNames()
 *//* w w  w .  j av  a  2s. com*/
@Override
public Enumeration getParameterNames() {
    final Set<String> parameterNames = this.parameters.keySet();
    return new IteratorEnumeration(parameterNames.iterator());
}

From source file:com.doculibre.constellio.utils.SimpleParamsHttpServletRequestWrapper.java

@SuppressWarnings("unchecked")
@Override/* ww w  . j  a v a 2  s  . c o m*/
public Enumeration getParameterNames() {
    Iterator<String> paramNamesIt = simpleParams.keySet().iterator();
    return new IteratorEnumeration(paramNamesIt);
}

From source file:net.sourceforge.fenixedu.presentationTier.Action.teacher.siteArchive.streams.FetcherRequestWrapper.java

@Override
public Enumeration getAttributeNames() {
    List<String> names = new ArrayList<String>();
    names.addAll(this.attributes.keySet());

    return new IteratorEnumeration(names.iterator());
}

From source file:com.mockey.server.RedoRequestWrapper.java

public Enumeration getHeaderNames() {
    return new IteratorEnumeration(headerMap.keySet().iterator());
}

From source file:guineu.desktop.impl.helpsystem.GuineuHelpMap.java

/**
 * Gets an enumeration of all the IDs in a Map.
 *
 * @return An enumeration of all the IDs in a Map.
 *///w w w  .  jav  a 2 s.  c  o m
public Enumeration<String> getAllIDs() {
    //return new FlatEnumeration(lookup.keys(), helpset);
    return new IteratorEnumeration(lookup.keySet().iterator());
}