All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.commons.util.EnumerationList Maven / Gradle / Ivy

There is a newer version: 15.1.0.Dev04
Show newest version
package org.infinispan.commons.util;

import java.util.Enumeration;
import java.util.LinkedList;
import java.util.List;


/**
 * An Enumeration → List adaptor
 *
 * @author Pete Muir
 */
public class EnumerationList extends ForwardingList
{
   // The enumeration as a list
   private final List list = new LinkedList();

   /**
    * Constructor
    *
    * @param enumeration The enumeration
    */
   public EnumerationList(Enumeration enumeration)
   {
      while (enumeration.hasMoreElements())
      {
         list.add(enumeration.nextElement());
      }
   }

   @Override
   protected List delegate()
   {
      return list;
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy