00001 /* 00002 * ListMuterator.hpp 00003 * 00004 * Copyright (c) 2000, 2013, 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_LIST_MUTERATOR_HPP 00017 #define COH_LIST_MUTERATOR_HPP 00018 00019 #include "coherence/lang.ns" 00020 00021 #include "coherence/util/ListIterator.hpp" 00022 #include "coherence/util/Muterator.hpp" 00023 00024 #include <ostream> 00025 00026 COH_OPEN_NAMESPACE2(coherence,util) 00027 00028 00029 /** 00030 * Muterator is mutating iterator, that is it is capable of changing the 00031 * list it iterates. 00032 * 00033 * @author mf 2008.05.05 00034 */ 00035 class COH_EXPORT ListMuterator 00036 : public interface_spec<ListMuterator, 00037 implements<ListIterator, Muterator> > 00038 { 00039 // ----- ListMuterator interface ---------------------------------------- 00040 00041 public: 00042 /** 00043 * Insert the specified element immediately before the element to be 00044 * returned from the next call to the next() method. A subsequent call 00045 * to next() will not return the added element, while a call to 00046 * previous() would return the added element. 00047 * 00048 * @param oh the element to add 00049 * 00050 * @throws UnsupportedOperationException if addition is not supported 00051 */ 00052 virtual void add(Object::Holder oh) = 0; 00053 00054 /** 00055 * Replace the last element returned by next() or previous() with 00056 * the specified element. 00057 * 00058 * @param oh the element to store 00059 * 00060 * @throws UnsupportedOperationException if set is not supported 00061 */ 00062 virtual void set(Object::Holder oh) = 0; 00063 }; 00064 00065 COH_CLOSE_NAMESPACE2 00066 00067 #endif // COH_LIST_MUTERATOR_HPP