1090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson/* 21d580d0f6ee4f21eb309ba7b509d2c6d671c4044Bjorn Bringert * Copyright (C) 2010 The Guava Authors 3090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * 4090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * Licensed under the Apache License, Version 2.0 (the "License"); 5090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * you may not use this file except in compliance with the License. 6090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * You may obtain a copy of the License at 7090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * 8090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * http://www.apache.org/licenses/LICENSE-2.0 9090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * 10090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * Unless required by applicable law or agreed to in writing, software 11090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * distributed under the License is distributed on an "AS IS" BASIS, 12090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * See the License for the specific language governing permissions and 14090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * limitations under the License. 15090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson */ 16090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson 17090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilsonpackage com.google.common.collect; 18090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson 19090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilsonimport com.google.common.annotations.GwtCompatible; 20090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson 211d580d0f6ee4f21eb309ba7b509d2c6d671c4044Bjorn Bringertimport java.util.ListIterator; 22090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson 23090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson/** 241d580d0f6ee4f21eb309ba7b509d2c6d671c4044Bjorn Bringert * A list iterator that does not support {@link #remove}, {@link #add}, or 251d580d0f6ee4f21eb309ba7b509d2c6d671c4044Bjorn Bringert * {@link #set}. 26090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * 271d580d0f6ee4f21eb309ba7b509d2c6d671c4044Bjorn Bringert * @since 7.0 281d580d0f6ee4f21eb309ba7b509d2c6d671c4044Bjorn Bringert * @author Louis Wasserman 29090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson */ 30090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson@GwtCompatible 310888a09821a98ac0680fad765217302858e70fa4Paul Duffinpublic abstract class UnmodifiableListIterator<E> 320888a09821a98ac0680fad765217302858e70fa4Paul Duffin extends UnmodifiableIterator<E> implements ListIterator<E> { 331d580d0f6ee4f21eb309ba7b509d2c6d671c4044Bjorn Bringert /** Constructor for use by subclasses. */ 341d580d0f6ee4f21eb309ba7b509d2c6d671c4044Bjorn Bringert protected UnmodifiableListIterator() {} 351d580d0f6ee4f21eb309ba7b509d2c6d671c4044Bjorn Bringert 361d580d0f6ee4f21eb309ba7b509d2c6d671c4044Bjorn Bringert /** 371d580d0f6ee4f21eb309ba7b509d2c6d671c4044Bjorn Bringert * Guaranteed to throw an exception and leave the underlying data unmodified. 381d580d0f6ee4f21eb309ba7b509d2c6d671c4044Bjorn Bringert * 391d580d0f6ee4f21eb309ba7b509d2c6d671c4044Bjorn Bringert * @throws UnsupportedOperationException always 407dd252788645e940eada959bdde927426e2531c9Paul Duffin * @deprecated Unsupported operation. 411d580d0f6ee4f21eb309ba7b509d2c6d671c4044Bjorn Bringert */ 420888a09821a98ac0680fad765217302858e70fa4Paul Duffin @Deprecated @Override public final void add(E e) { 431d580d0f6ee4f21eb309ba7b509d2c6d671c4044Bjorn Bringert throw new UnsupportedOperationException(); 441d580d0f6ee4f21eb309ba7b509d2c6d671c4044Bjorn Bringert } 451d580d0f6ee4f21eb309ba7b509d2c6d671c4044Bjorn Bringert 46090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson /** 47090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * Guaranteed to throw an exception and leave the underlying data unmodified. 48090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * 49090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson * @throws UnsupportedOperationException always 507dd252788645e940eada959bdde927426e2531c9Paul Duffin * @deprecated Unsupported operation. 51090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson */ 520888a09821a98ac0680fad765217302858e70fa4Paul Duffin @Deprecated @Override public final void set(E e) { 53090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson throw new UnsupportedOperationException(); 54090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson } 55090f9b4c879985bc747c214f82c62471e60c7742Jesse Wilson} 56