00001 /* 00002 * Enumeration.hpp 00003 * 00004 * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. 00005 * 00006 * Oracle is a registered trademarks of Oracle Corporation and/or its 00007 * affiliates. 00008 * 00009 * This software is the confidential and proprietary information of Oracle 00010 * Corporation. You shall not disclose such confidential and proprietary 00011 * information and shall use it only in accordance with the terms of the 00012 * license agreement you entered into with Oracle. 00013 * 00014 * This notice may not be removed or altered. 00015 */ 00016 #ifndef COH_ENUMERATION_HPP 00017 #define COH_ENUMERATION_HPP 00018 00019 #include "coherence/lang.ns" 00020 00021 COH_OPEN_NAMESPACE2(coherence,util) 00022 00023 00024 /** 00025 * An object that implements the Enumeration interface generates a series of 00026 * elements, one at a time. Successive calls to the nextElement method return 00027 * successive elements of the series. 00028 * 00029 * @author tb 2010.10.16 00030 */ 00031 class COH_EXPORT Enumeration 00032 : public interface_spec<Enumeration> 00033 { 00034 // ----- Enumeration interface --------------------------------------------- 00035 00036 public: 00037 /** 00038 * Tests if this enumeration contains more elements. 00039 * 00040 * @return true if and only if this enumeration object contains at 00041 * least one more element to provide; false otherwise 00042 */ 00043 virtual bool hasMoreElements() const = 0; 00044 00045 /** 00046 * Returns the next element of this enumeration if this enumeration 00047 * object has at least one more element to provide. 00048 * 00049 * @return the next element of this enumeration 00050 * 00051 * @throws coherence::lang::NoSuchElementException if no more elements 00052 * exist. 00053 */ 00054 virtual Object::Holder nextElement() = 0; 00055 }; 00056 00057 COH_CLOSE_NAMESPACE2 00058 00059 #endif // COH_ENUMERATION_HPP