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

org.azolla.l.ling.util.Enumeration0 Maven / Gradle / Ivy

There is a newer version: 2.0.3
Show newest version
/*
 * @(#)Enumeration0.java		Created at 2013-6-30
 * 
 * Copyright (c) 2011-2013 azolla.org All rights reserved.
 * Azolla PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 
 */
package org.azolla.l.ling.util;

import java.util.Collections;
import java.util.Enumeration;
import java.util.Iterator;

import com.google.common.collect.Iterators;

/**
 * EnumerationHelper
 *
 * @author 	[email protected]
 * @since 	ADK1.0
 */
public final class Enumeration0
{
    public static  Iterable toIterable(final Enumeration enumerator)
    {
        return new Iterable()
        {
            @Override
            public Iterator iterator()
            {
                return null == enumerator ? Collections.emptyIterator() : Iterators.forEnumeration(enumerator);
            }
        };
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy