01: /*
02: * The JTS Topology Suite is a collection of Java classes that
03: * implement the fundamental operations required to validate a given
04: * geo-spatial data set to a known topological specification.
05: *
06: * Copyright (C) 2001 Vivid Solutions
07: *
08: * This library is free software; you can redistribute it and/or
09: * modify it under the terms of the GNU Lesser General Public
10: * License as published by the Free Software Foundation; either
11: * version 2.1 of the License, or (at your option) any later version.
12: *
13: * This library is distributed in the hope that it will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16: * Lesser General Public License for more details.
17: *
18: * You should have received a copy of the GNU Lesser General Public
19: * License along with this library; if not, write to the Free Software
20: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21: *
22: * For more information, contact:
23: *
24: * Vivid Solutions
25: * Suite #1A
26: * 2328 Government Street
27: * Victoria BC V8T 5G5
28: * Canada
29: *
30: * (250)385-6040
31: * www.vividsolutions.com
32: */
33: package com.vividsolutions.jts.geom;
34:
35: import java.io.Serializable;
36:
37: /**
38: * Creates CoordinateSequences represented as an array of {@link Coordinate}s.
39: *
40: * @version 1.7
41: *
42: * @deprecated no longer used
43: */
44: public class DefaultCoordinateSequenceFactory implements
45: CoordinateSequenceFactory, Serializable {
46: private static final long serialVersionUID = -4099577099607551657L;
47: private static final DefaultCoordinateSequenceFactory instanceObject = new DefaultCoordinateSequenceFactory();
48:
49: public DefaultCoordinateSequenceFactory() {
50: }
51:
52: private Object readResolve() {
53: // see http://www.javaworld.com/javaworld/javatips/jw-javatip122.html
54: return DefaultCoordinateSequenceFactory.instance();
55: }
56:
57: /**
58: * Returns the singleton instance of DefaultCoordinateSequenceFactory
59: */
60: public static DefaultCoordinateSequenceFactory instance() {
61: return instanceObject;
62: }
63:
64: /**
65: * Returns a DefaultCoordinateSequence based on the given array (the array is
66: * not copied).
67: *
68: * @param coordinates
69: * the coordinates, which may not be null nor contain null
70: * elements
71: */
72: public CoordinateSequence create(Coordinate[] coordinates) {
73: return new DefaultCoordinateSequence(coordinates);
74: }
75:
76: /**
77: * @see com.vividsolutions.jts.geom.CoordinateSequenceFactory#create(com.vividsolutions.jts.geom.CoordinateSequence)
78: */
79: public CoordinateSequence create(CoordinateSequence coordSeq) {
80: return new DefaultCoordinateSequence(coordSeq);
81: }
82:
83: /**
84: * @see com.vividsolutions.jts.geom.CoordinateSequenceFactory#create(int, int)
85: */
86: public CoordinateSequence create(int size, int dimension) {
87: return new DefaultCoordinateSequence(size);
88: }
89: }
|