001: /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
002: * This code is licensed under the GPL 2.0 license, availible at the root
003: * application directory.
004: */
005: package org.geoserver.feature;
006:
007: import com.vividsolutions.jts.geom.Envelope;
008: import com.vividsolutions.jts.geom.Geometry;
009: import org.geotools.feature.CollectionListener;
010: import org.geotools.feature.FeatureCollection;
011: import org.geotools.feature.FeatureIterator;
012: import org.geotools.feature.FeatureList;
013: import org.geotools.feature.FeatureType;
014: import org.geotools.feature.IllegalAttributeException;
015: import org.geotools.feature.visitor.FeatureVisitor;
016: import org.geotools.geometry.jts.ReferencedEnvelope;
017: import org.geotools.util.ProgressListener;
018: import org.opengis.filter.Filter;
019: import org.opengis.filter.sort.SortBy;
020: import java.io.IOException;
021: import java.util.Collection;
022: import java.util.Iterator;
023:
024: /**
025: * Base class for a feature collection with decorates another feature collection.
026: * <p>
027: * Subclasses should override methods as needed to "decorate" .
028: * </p>
029: *
030: * @author Justin Deoliveira, The Open Planning Project, jdeolive@openplans.org
031: *
032: */
033: public class DecoratingFeatureCollection implements FeatureCollection {
034: protected FeatureCollection delegate;
035:
036: public DecoratingFeatureCollection(FeatureCollection delegate) {
037: this .delegate = delegate;
038: }
039:
040: public FeatureIterator features() {
041: return delegate.features();
042: }
043:
044: public Iterator iterator() {
045: return delegate.iterator();
046: }
047:
048: public void purge() {
049: delegate.purge();
050: }
051:
052: public void close(FeatureIterator iterator) {
053: delegate.close(iterator);
054: }
055:
056: public void close(Iterator iterator) {
057: delegate.close(iterator);
058: }
059:
060: public void addListener(CollectionListener listenter)
061: throws NullPointerException {
062: delegate.addListener(listenter);
063: }
064:
065: public void removeListener(CollectionListener listener)
066: throws NullPointerException {
067: delegate.removeListener(listener);
068: }
069:
070: public FeatureType getFeatureType() {
071: return delegate.getFeatureType();
072: }
073:
074: public FeatureType getSchema() {
075: return delegate.getSchema();
076: }
077:
078: public void accepts(FeatureVisitor visitor,
079: ProgressListener listener) throws IOException {
080: delegate.accepts(visitor, listener);
081: }
082:
083: public FeatureCollection subCollection(Filter filter) {
084: return delegate.subCollection(filter);
085: }
086:
087: public FeatureList sort(SortBy sortBy) {
088: return delegate.sort(sortBy);
089: }
090:
091: public int size() {
092: return delegate.size();
093: }
094:
095: public void clear() {
096: delegate.clear();
097: }
098:
099: public boolean isEmpty() {
100: return delegate.isEmpty();
101: }
102:
103: public Object[] toArray() {
104: return delegate.toArray();
105: }
106:
107: public boolean add(Object o) {
108: return delegate.add(o);
109: }
110:
111: public boolean contains(Object o) {
112: return delegate.contains(o);
113: }
114:
115: public boolean remove(Object o) {
116: return delegate.remove(o);
117: }
118:
119: public boolean addAll(Collection c) {
120: return delegate.addAll(c);
121: }
122:
123: public boolean containsAll(Collection c) {
124: return delegate.containsAll(c);
125: }
126:
127: public boolean removeAll(Collection c) {
128: return delegate.removeAll(c);
129: }
130:
131: public boolean retainAll(Collection c) {
132: return delegate.retainAll(c);
133: }
134:
135: public Object[] toArray(Object[] a) {
136: return delegate.toArray(a);
137: }
138:
139: public ReferencedEnvelope getBounds() {
140: return delegate.getBounds();
141: }
142:
143: public String getID() {
144: return delegate.getID();
145: }
146:
147: public Object[] getAttributes(Object[] array) {
148: return delegate.getAttributes(array);
149: }
150:
151: public Object getAttribute(String name) {
152: return delegate.getAttribute(name);
153: }
154:
155: public Object getAttribute(int index) {
156: return delegate.getAttribute(index);
157: }
158:
159: public void setAttribute(int index, Object value)
160: throws IllegalAttributeException,
161: ArrayIndexOutOfBoundsException {
162: delegate.setAttribute(index, value);
163: }
164:
165: public int getNumberOfAttributes() {
166: return delegate.getNumberOfAttributes();
167: }
168:
169: public void setAttribute(String name, Object value)
170: throws IllegalAttributeException {
171: delegate.setAttribute(name, value);
172: }
173:
174: public Geometry getDefaultGeometry() {
175: return delegate.getDefaultGeometry();
176: }
177:
178: public void setDefaultGeometry(Geometry geometry)
179: throws IllegalAttributeException {
180: delegate.setDefaultGeometry(geometry);
181: }
182:
183: }
|