01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2003-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; either
09: * version 2.1 of the License, or (at your option) any later version.
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;
17:
18: import java.io.IOException;
19: import java.util.NoSuchElementException;
20:
21: import org.geotools.feature.Feature;
22: import org.geotools.feature.FeatureType;
23: import org.geotools.feature.IllegalAttributeException;
24:
25: /**
26: *
27: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/main/src/test/java/org/geotools/data/TestReader.java $
28: */
29: class TestReader implements FeatureReader {
30:
31: /**
32: *
33: */
34: private FeatureType type;
35: private Feature feature;
36:
37: public TestReader(FeatureType type, Feature f) {
38: this .type = type;
39: this .feature = f;
40: }
41:
42: public FeatureType getFeatureType() {
43: return type;
44: }
45:
46: public Feature next() throws IOException,
47: IllegalAttributeException, NoSuchElementException {
48: next = false;
49: return feature;
50: }
51:
52: boolean next = true;
53:
54: public boolean hasNext() throws IOException {
55: return next;
56: }
57:
58: public void close() throws IOException {
59: }
60:
61: }
|