com.day.util.EnumerationIterator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aem-sdk-api Show documentation
Show all versions of aem-sdk-api Show documentation
The Adobe Experience Manager SDK
/*************************************************************************
* ADOBE CONFIDENTIAL
* __________________
*
* Copyright 2020 Adobe
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Adobe and its suppliers, if any. The intellectual
* and technical concepts contained herein are proprietary to Adobe
* and its suppliers and are protected by all applicable intellectual
* property laws, including trade secret and copyright laws.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe.
**************************************************************************/
package com.day.util;
import java.util.Enumeration;
import java.util.Iterator;
/**
* The EnumerationIterator
implements an Iterator
that
* iterates over a given Enumeration
. This is usefull, when needing
* an Iterator
but having an Enumeration
.
*
* @version $Revision: 1.7 $
* @author tripod
* @since antbear
* Audience wad
*/
public class EnumerationIterator implements Iterator {
/** the internal enumeratrion */
private final Enumeration delegatee;
/**
* Constructs an EnuerationIterator
* @param delegatee the underlaying enumeration
*/
public EnumerationIterator(Enumeration delegatee) {
this.delegatee = delegatee;
}
/**
* @see Iterator#hasNext()
*/
public boolean hasNext() {
return delegatee.hasMoreElements();
}
/**
* @see Iterator#next()
*/
public Object next() {
return delegatee.nextElement();
}
/**
* Always throws UnsupportedOperationException
.
*
* @see Iterator#remove()
*/
public void remove() {
throw new UnsupportedOperationException();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy