org.wkb4j.engine
Interface WKBFactory

All Known Implementing Classes:
AbstractWKBFactory

public interface WKBFactory

WKBFactory must be implemented by any class wishing to serve as a factory for geometric objects. When an object implements this interface, it can be submitted to the WKBParser and it will call thoses methods with the correct values. The author of each factory is completly free to implement any behavior, including ignoring some calls.
wkbByteOrders and wkbTypes values don't generate events because there is no point in doing so. Similarly, there is no way to pass a generic Geometry. MultiPoints, WKBPoints and Points are colapsed in a double array. It is the responsability of the Factory to ensure that the stream of events actually represents a correct construction. See AbstractWKBFactory for an implementation of a "validating" WKBFactory.
Inspired by the SAX API.

Version:
$Revision: 1.7 $ $Date: 2003/07/28 22:21:26 $
Author:
David Garnier
Creation date: 6 juil. 2002 21:22:00

Method Summary
 void abortGeometryCollection()
          Signals a malformed GeometryCollection.
 void abortLinearRing()
          Signals a malformed LinearRing.
 void abortLineString()
          Signals a malformed LineString.
 void abortMultiLineString()
          Signals a malformed MultiLineString.
 void abortMultiPoint()
          Signals a malformed MultiPoint.
 void abortMultiPolygon()
          Signals a malformed MultiPolygon.
 void abortPoint()
          Signals a malformed Point.
 void abortPolygon()
          Signals a malformed Polygon.
 void abortUnit()
          Signals the problematic stop of the transcription process for a Geometry.
 void abortWork()
          Signals the problematic stop of the transcription process for a buffer of WKB data.
 boolean addPoints(double[] points)
          points is an array of doubles reprensentings coordinates.
 boolean beginGeometryCollection(int count)
          Signals the beginning of a new GeometryCollection.
 boolean beginLinearRing(int count)
          Signals the beginning of a new LinearRing.
 boolean beginLineString(int count)
          Signals the beginning of a new LineString
 boolean beginMultiLineString(int count)
          Signals the beginning of a new MultiLineString.
 boolean beginMultiPoint(int count)
          Signals the beginning of a new MultiPoint.
 boolean beginMultiPolygon(int count)
          Signals the beginning of a new MultiPolygon.
 boolean beginPoint()
          Signals the beginning of a new Point
 boolean beginPolygon(int count)
          Signals the beginning of a new Polygon.
 void beginUnit(int srid)
          Signals the beginning of the transcription process for a Geometry.
 void beginUnit(java.lang.String[] words, int[] values)
          Signals the beginning of the transcription process for a Geometry.
 void beginWork()
          Signals the beginning of the transcription process for a buffer of WKB data.
 boolean endGeometryCollection()
          Signals the end of a GeometryCollection.
 boolean endLinearRing()
          Signals the end of a LinearRing.
 boolean endLineString()
          Signals the end of a LineString.
 boolean endMultiLineString()
          Signals the end of a MultiLineString.
 boolean endMultiPoint()
          Signals the end of a MultiPoint.
 boolean endMultiPolygon()
          Signals the end of a MultiPolygon.
 boolean endPoint()
          Signals the end of a Point.
 boolean endPolygon()
          Signals the end of a Polygon.
 void endUnit()
          Signals the end of the transcription process for a Geometry.
 void endWork()
          Signals the end of the transcription process for a buffer of WKB data.
 boolean newGeometryCollectionComponent()
          Signals that a new component for the geometry factory is about to processed OR that all components has been used.
 

Method Detail

beginWork

public void beginWork()
Signals the beginning of the transcription process for a buffer of WKB data.


endWork

public void endWork()
Signals the end of the transcription process for a buffer of WKB data.


abortWork

public void abortWork()
Signals the problematic stop of the transcription process for a buffer of WKB data.


beginUnit

public void beginUnit(int srid)
Signals the beginning of the transcription process for a Geometry. The submitted SRID will be assigned to all the Geometries contained in this Geometry


beginUnit

public void beginUnit(java.lang.String[] words,
                      int[] values)
Signals the beginning of the transcription process for a Geometry. The submitted values will be available to all the Geometries contained in this Geometry


endUnit

public void endUnit()
Signals the end of the transcription process for a Geometry.


abortUnit

public void abortUnit()
Signals the problematic stop of the transcription process for a Geometry.


beginGeometryCollection

public boolean beginGeometryCollection(int count)
Signals the beginning of a new GeometryCollection.

Parameters:
count - the number of elements in the GeometryCollection.

endGeometryCollection

public boolean endGeometryCollection()
Signals the end of a GeometryCollection.


abortGeometryCollection

public void abortGeometryCollection()
Signals a malformed GeometryCollection. This can happen at any time, and Factories should just skip the malformed Geometry and maybe escalate the error.


beginLineString

public boolean beginLineString(int count)
Signals the beginning of a new LineString. * @param count the number of elements in the LineString


endLineString

public boolean endLineString()
Signals the end of a LineString.


abortLineString

public void abortLineString()
Signals a malformed LineString. This can happen at any time, and Factories should just skip the malformed and maybe escalate the error.


beginMultiLineString

public boolean beginMultiLineString(int count)
Signals the beginning of a new MultiLineString.

Parameters:
count - the number of elements in the MultiLineString.

endMultiLineString

public boolean endMultiLineString()
Signals the end of a MultiLineString.


abortMultiLineString

public void abortMultiLineString()
Signals a malformed MultiLineString. This can happen at any time, and Factories should just skip the malformed Geometry and maybe escalate the error.


beginPoint

public boolean beginPoint()
Signals the beginning of a new Point. * @param count the number of elements in the Point


endPoint

public boolean endPoint()
Signals the end of a Point.


abortPoint

public void abortPoint()
Signals a malformed Point. This can happen at any time, and Factories should just skip the malformed and maybe escalate the error.


beginMultiPoint

public boolean beginMultiPoint(int count)
Signals the beginning of a new MultiPoint.

Parameters:
count - the number of elements in the MultiPoint.

endMultiPoint

public boolean endMultiPoint()
Signals the end of a MultiPoint.


abortMultiPoint

public void abortMultiPoint()
Signals a malformed MultiPoint. This can happen at any time, and Factories should just skip the malformed Geometry and maybe escalate the error.


beginMultiPolygon

public boolean beginMultiPolygon(int count)
Signals the beginning of a new MultiPolygon.

Parameters:
count - the number of elements in the MultiPolygon.

endMultiPolygon

public boolean endMultiPolygon()
Signals the end of a MultiPolygon.


abortMultiPolygon

public void abortMultiPolygon()
Signals a malformed MultiPolygon. This can happen at any time, and Factories should just skip the malformed Geometry and maybe escalate the error.


beginPolygon

public boolean beginPolygon(int count)
Signals the beginning of a new Polygon.

Parameters:
count - the number of elements in the Polygon.

endPolygon

public boolean endPolygon()
Signals the end of a Polygon.


abortPolygon

public void abortPolygon()
Signals a malformed Polygon. This can happen at any time, and Factories should just skip the malformed Geometry and maybe escalate the error.


addPoints

public boolean addPoints(double[] points)
points is an array of doubles reprensentings coordinates. They are in the same order as the data in the WKB format. addPoints() and addPoints3D() are mutually exclusive and can only be called once.


beginLinearRing

public boolean beginLinearRing(int count)
Signals the beginning of a new LinearRing.

Parameters:
count - the number of elements in the LinearRing.

endLinearRing

public boolean endLinearRing()
Signals the end of a LinearRing.


abortLinearRing

public void abortLinearRing()
Signals a malformed LinearRing. This can happen at any time, and Factories should just skip the malformed Geometry and maybe escalate the error.


newGeometryCollectionComponent

public boolean newGeometryCollectionComponent()
Signals that a new component for the geometry factory is about to processed OR that all components has been used. and therefore that the current WKBFactory should take adequate steps.



Copyright © 2002-2003 David Garnier. All Rights Reserved.