01: //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/trunk/src/org/deegree/io/shpapi/shape_new/Shape.java $
02: /*---------------- FILE HEADER ------------------------------------------
03: This file is part of deegree.
04: Copyright (C) 2001-2008 by:
05: Department of Geography, University of Bonn
06: http://www.giub.uni-bonn.de/deegree/
07: lat/lon GmbH
08: http://www.lat-lon.de
09:
10: This library is free software; you can redistribute it and/or
11: modify it under the terms of the GNU Lesser General Public
12: License as published by the Free Software Foundation; either
13: version 2.1 of the License, or (at your option) any later version.
14:
15: This library is distributed in the hope that it will be useful,
16: but WITHOUT ANY WARRANTY; without even the implied warranty of
17: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18: Lesser General Public License for more details.
19:
20: You should have received a copy of the GNU Lesser General Public
21: License along with this library; if not, write to the Free Software
22: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23:
24: Contact:
25:
26: Andreas Poth
27: lat/lon GmbH
28: Aennchenstr. 19
29: 53177 Bonn
30: Germany
31: E-Mail: poth@lat-lon.de
32:
33: Prof. Dr. Klaus Greve
34: Department of Geography
35: University of Bonn
36: Meckenheimer Allee 166
37: 53115 Bonn
38: Germany
39: E-Mail: greve@giub.uni-bonn.de
40:
41: ---------------------------------------------------------------------------*/
42: package org.deegree.io.shpapi.shape_new;
43:
44: import org.deegree.model.spatialschema.Geometry;
45:
46: /**
47: * <code>Shape</code> defines methods to read, write and use objects read from/written to a
48: * shapefile (as well as some basic information).
49: *
50: * @author <a href="mailto:schmitz@lat-lon.de">Andreas Schmitz</a>
51: * @author last edited by: $Author: apoth $
52: *
53: * @version $Revision: 9342 $, $Date: 2007-12-27 04:32:57 -0800 (Thu, 27 Dec 2007) $
54: */
55: public interface Shape {
56:
57: /**
58: * Reads the object from a byte array.
59: *
60: * @param bytes
61: * @param offset
62: * where to start reading
63: * @return the new offset or -1, if the type was wrong.
64: */
65: public int read(byte[] bytes, int offset);
66:
67: /**
68: * Writes the object to a byte array.
69: *
70: * @param bytes
71: * @param offset
72: * @return the new offset.
73: */
74: public int write(byte[] bytes, int offset);
75:
76: /**
77: * @return the number of bytes necessary to write this instance.
78: */
79: public int getByteLength();
80:
81: /**
82: * @return the type of the shape
83: */
84: public int getType();
85:
86: /**
87: * @return the shapes' envelope, or null, if it has none
88: */
89: public ShapeEnvelope getEnvelope();
90:
91: /**
92: * @return the shape as deegree Geometry
93: * @throws ShapeGeometryException
94: * if the deegree geometry could not be constructed
95: */
96: public Geometry getGeometry() throws ShapeGeometryException;
97:
98: }
|