01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2005-2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.data.store;
17:
18: import java.util.Iterator;
19:
20: import org.geotools.feature.FeatureIterator;
21:
22: /**
23: * An {@link Iterator} which delegates to a {@link FeatureIterator}.
24: *
25: * @author Justin Deoliveira, The Open Planning Project, jdeolive@openplans.org
26: * @since 2.4
27: *
28: */
29: public class FeatureIteratorIterator implements Iterator {
30:
31: /**
32: * delegate feature iterator.
33: */
34: FeatureIterator delegate;
35:
36: /**
37: * Creates the new iterator.
38: *
39: * @param delegate The iterator to delegate to.
40: */
41: public FeatureIteratorIterator(FeatureIterator delegate) {
42: this .delegate = delegate;
43: }
44:
45: /**
46: * Calls through to {@link FeatureIterator#hasNext()}
47: */
48: public boolean hasNext() {
49: return delegate.hasNext();
50: }
51:
52: /**
53: * Calls through to {@link FeatureIterator#next()}
54: */
55: public Object next() {
56: return delegate.next();
57: }
58:
59: /**
60: * @throws UnsupportedOperationException
61: */
62: public void remove() {
63: throw new UnsupportedOperationException(
64: "remove is not supported");
65: }
66:
67: /**
68: * @return The underlying delegate.
69: */
70: public FeatureIterator getDelegate() {
71: return delegate;
72: }
73: }
|