| org.geotools.data.shapefile.shp.ShapeHandler
All known Subclasses: org.geotools.data.shapefile.shp.MultiLineHandler, org.geotools.renderer.shape.shapehandler.simple.PolygonHandler, org.geotools.renderer.shape.shapehandler.simple.MultiPointHandler, org.geotools.renderer.shape.shapehandler.simple.PointHandler, org.geotools.renderer.shape.shapehandler.simple.MultiLineHandler, org.geotools.data.shapefile.shp.PolygonHandler, org.geotools.data.shapefile.shp.PointHandler, org.geotools.data.shapefile.shp.MultiPointHandler,
ShapeHandler | public interface ShapeHandler (Code) | | A ShapeHandler defines what is needed to construct and persist geometries
based upon the shapefile specification.
author: aaime author: Ian Schneider |
Method Summary | |
public int | getLength(Object geometry) Get the length of the given geometry Object in bytes not 16-bit words.
This is easier to keep track of, since the ByteBuffer deals with bytes. | public ShapeType | getShapeType() Get the ShapeType of this handler. | public Object | read(ByteBuffer buffer, ShapeType type) Read a geometry from the ByteBuffer. | public void | write(ByteBuffer buffer, Object geometry) Write the geometry into the ByteBuffer. |
getLength | public int getLength(Object geometry)(Code) | | Get the length of the given geometry Object in bytes not 16-bit words.
This is easier to keep track of, since the ByteBuffer deals with bytes. Do
not include the 8 bytes of record.
Parameters: geometry - The geometry to analyze. The number of bytes the shape will take up. |
getShapeType | public ShapeType getShapeType()(Code) | | Get the ShapeType of this handler.
The ShapeType. |
read | public Object read(ByteBuffer buffer, ShapeType type)(Code) | | Read a geometry from the ByteBuffer. The buffer's position, byteOrder, and limit
are set to that which is needed. The record has been read as well as the shape
type integer. The handler need not worry about reading unused information as
the ShapefileReader will correctly adjust the buffer position after this call.
Parameters: buffer - The ByteBuffer to read from. A geometry object. |
write | public void write(ByteBuffer buffer, Object geometry)(Code) | | Write the geometry into the ByteBuffer. The position, byteOrder, and limit are
all set. The handler is not responsible for writing the record or
shape type integer.
Parameters: buffer - The ByteBuffer to write to. Parameters: geometry - The geometry to write. |
|
|