01: /* uDig - User Friendly Desktop Internet GIS client
02: * http://udig.refractions.net
03: * (C) 2004, Refractions Research Inc.
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation;
08: * version 2.1 of the License.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: */
15: package net.refractions.udig.tools.edit.support;
16:
17: import java.util.AbstractList;
18: import java.util.List;
19:
20: import com.vividsolutions.jts.geom.Coordinate;
21:
22: /**
23: * A list that will wraps a List<LazyCoord> and resolves the LazyCoords into coordinate when
24: * requested.
25: *
26: * @author jones
27: * @since 1.1.0
28: */
29: public class CoordResolvingList extends AbstractList<Coordinate> {
30: final List<LazyCoord> wrapped;
31: private final Point current;
32:
33: public CoordResolvingList(List<LazyCoord> list2, Point current2) {
34: this .wrapped = list2;
35: this .current = current2;
36: }
37:
38: @Override
39: public Coordinate get(int index) {
40: return this .wrapped.get(index).get(current);
41: }
42:
43: @Override
44: public int size() {
45: return this.wrapped.size();
46: }
47:
48: }
|