Package org.geotools.data.shapefile.shp
Class PointHandler
Object
PointHandler
- All Implemented Interfaces:
ShapeHandler
Wrapper for a Shapefile point.
- Author:
- aaime, Ian Schneider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Get the length of the given geometry Object in bytes not 16-bit words.Returns the shapefile shape type value for a pointread
(ByteBuffer buffer, ShapeType type, boolean flatGeometry) Read a geometry from the ByteBuffer.void
write
(ByteBuffer buffer, Object geometry) Write the geometry into the ByteBuffer.
-
Constructor Details
-
PointHandler
- Throws:
ShapefileException
-
PointHandler
public PointHandler()
-
-
Method Details
-
getShapeType
Returns the shapefile shape type value for a point- Specified by:
getShapeType
in interfaceShapeHandler
- Returns:
- int Shapefile.POINT
-
getLength
Description copied from interface:ShapeHandler
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.- Specified by:
getLength
in interfaceShapeHandler
- Parameters:
geometry
- The geometry to analyze.- Returns:
- The number of bytes the shape will take up.
-
read
Description copied from interface:ShapeHandler
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.- Specified by:
read
in interfaceShapeHandler
- Parameters:
buffer
- The ByteBuffer to read from.- Returns:
- A geometry object.
-
write
Description copied from interface:ShapeHandler
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.- Specified by:
write
in interfaceShapeHandler
- Parameters:
buffer
- The ByteBuffer to write to.geometry
- The geometry to write.
-