org.azolla.l.ling.util.Enumeration0 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.azolla.l.ling Show documentation
Show all versions of org.azolla.l.ling Show documentation
Azolla.org Core Library for Java
/*
* @(#)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);
}
};
}
}